From: York Sun Date: Mon, 25 Mar 2013 10:40:22 -0700 Subject: [U-Boot] [Patch v2, batch 4 26/29] powerpc/usb: Fix usb device-tree fix-up In-Reply-To: <1364233225-31262-1-git-send-email-yorksun@freescale.com> References: <1364233225-31262-1-git-send-email-yorksun@freescale.com> Message-ID: <1364233225-31262-26-git-send-email-yorksun@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Ramneek Mehresh 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 --- arch/powerpc/cpu/mpc8xxx/fdt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/cpu/mpc8xxx/fdt.c b/arch/powerpc/cpu/mpc8xxx/fdt.c index 2847094..26dc5f0 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) { + printf("WARNING: wrong usb mode/phy defined!!\n"); + return; + } + dr_mode_type = modes[mode_idx]; dr_phy_type = phys[phy_idx]; -- 1.7.9.5