Patchwork [U-Boot] powerpc/usb: Fix usb device-tree fix-up

login
register
mail settings
Submitter ramneek mehresh
Date Feb. 7, 2013, 3:26 a.m.
Message ID <1360207562-1784-1-git-send-email-ramneek.mehresh@freescale.com>
Download mbox | patch
Permalink /patch/218818/
State Superseded
Headers show

Comments

ramneek mehresh - Feb. 7, 2013, 3:26 a.m.
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 <ramneek.mehresh@freescale.com>
---

 arch/powerpc/cpu/mpc8xxx/fdt.c | 6 ++++++
 1 file changed, 6 insertions(+)
Wolfgang Denk - Feb. 7, 2013, 5:20 a.m.
Dear Ramneek Mehresh,

In message <1360207562-1784-1-git-send-email-ramneek.mehresh@freescale.com> you wrote:
> 
> +			if (mode_idx < 0 || phy_idx < 0) {
> +				printf("WARNING: wrong usb mode/phy"
> +					" defined!!\n");
> +				return;
> +			}

As you take a return here, this appears to be an ERROR rather than a
warning?

Best regards,

Wolfgang Denk

Patch

diff --git a/arch/powerpc/cpu/mpc8xxx/fdt.c b/arch/powerpc/cpu/mpc8xxx/fdt.c
index 2847094..413e184 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("WARNING: wrong usb mode/phy"
+					" defined!!\n");
+				return;
+			}
+
 			dr_mode_type = modes[mode_idx];
 			dr_phy_type = phys[phy_idx];