Commit 91d7746df89f858548fe535137b4b185a6a76d59

Authored by Nikhil Badola
Committed by York Sun
1 parent c6e8f49a16

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/usb/host/ehci-fsl.c
... ... @@ -86,7 +86,7 @@
86 86 #endif
87 87 }
88 88  
89   - if (!strcmp(phy_type, "utmi")) {
  89 + if (!strncmp(phy_type, "utmi", 4)) {
90 90 #if defined(CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY)
91 91 setbits_be32(&ehci->control, PHY_CLK_SEL_UTMI);
92 92 setbits_be32(&ehci->control, UTMI_PHY_EN);