summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Badola <nikhil.badola@freescale.com>2014-02-17 16:58:36 +0530
committerYork Sun <yorksun@freescale.com>2014-02-24 15:23:57 -0800
commit91d7746df89f858548fe535137b4b185a6a76d59 (patch)
tree7fe4469fde83b11730060688420ec005f56738b9
parentc6e8f49a16915822ffe25904daf1fc9c28115ed4 (diff)
downloadu-boot-imx-91d7746df89f858548fe535137b4b185a6a76d59.zip
u-boot-imx-91d7746df89f858548fe535137b4b185a6a76d59.tar.gz
u-boot-imx-91d7746df89f858548fe535137b4b185a6a76d59.tar.bz2
fsl/usb: Limit phy_type comparison to first four characters
Use first four characters for phy_type comparison. Strcmp() should not be used to check the phy_type string which maybe parsed by hwconfig_subarg(). Hwconfig_subarg() returns part of hwconfig string starting from phy_type value till the end of the string. Since phy_type could be either "utmi" or "ulpi", strncmp() should be used so that a comparison of "utmi;fsl_ddr:bank_intlv=auto" with "utmi" will succeed. Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
-rw-r--r--drivers/usb/host/ehci-fsl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 45e5d6a..1ca7cf5 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -86,7 +86,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
#endif
}
- if (!strcmp(phy_type, "utmi")) {
+ if (!strncmp(phy_type, "utmi", 4)) {
#if defined(CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY)
setbits_be32(&ehci->control, PHY_CLK_SEL_UTMI);
setbits_be32(&ehci->control, UTMI_PHY_EN);