From patchwork Fri Feb 8 04:14:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2] powerpc/usb: Fix usb device-tree fix-up From: ramneek mehresh X-Patchwork-Id: 219047 Message-Id: <1360296886-2444-1-git-send-email-ramneek.mehresh@freescale.com> To: Cc: Ramneek Mehresh Date: Fri, 8 Feb 2013 09:44:46 +0530 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 --- Changes for v2: - changed "WARNING" message to "ERROR" message arch/powerpc/cpu/mpc8xxx/fdt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/cpu/mpc8xxx/fdt.c b/arch/powerpc/cpu/mpc8xxx/fdt.c index 2847094..857adeb 100644 --- a/arch/powerpc/cpu/mpc8xxx/fdt.c +++ b/arch/powerpc/cpu/mpc8xxx/fdt.c @@ -167,6 +167,12 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd) } } + if (mode_idx < 0 || phy_idx < 0) { + printf("ERROR: wrong usb mode/phy" + " defined!!\n"); + return; + } + dr_mode_type = modes[mode_idx]; dr_phy_type = phys[phy_idx];