From: ramneek mehresh Date: Sun, 17 Feb 2013 18:23:32 +0000 (+0000) Subject: powerpc/usb: Fix usb device-tree fix-up X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=dda48e8efff878e51e986befd9c6c3780b4757a7;p=u-boot.git powerpc/usb: Fix usb device-tree fix-up Fix USB device-tree fixup to properly handle device-tree fixup and print appropriate message when wrong/junk "dr_mode" or "phy_type" are mentioned in hwconfig string Signed-off-by: Ramneek Mehresh --- diff --git a/arch/powerpc/cpu/mpc8xxx/fdt.c b/arch/powerpc/cpu/mpc8xxx/fdt.c index 284709428d..2db90455f6 100644 --- a/arch/powerpc/cpu/mpc8xxx/fdt.c +++ b/arch/powerpc/cpu/mpc8xxx/fdt.c @@ -167,6 +167,11 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd) } } + if (mode_idx < 0 || phy_idx < 0) { + puts("ERROR: wrong usb mode/phy defined!!\n"); + return; + } + dr_mode_type = modes[mode_idx]; dr_phy_type = phys[phy_idx];