소스 검색

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 <ramneek.mehresh@freescale.com>
ramneek mehresh 12 년 전
부모
커밋
dda48e8eff
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      arch/powerpc/cpu/mpc8xxx/fdt.c

+ 5 - 0
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];