All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH][v2] fsl/usb: Limit phy_type comparison to first four characters
@ 2014-02-17 11:28 Nikhil Badola
  2014-02-24 23:58 ` York Sun
  0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Badola @ 2014-02-17 11:28 UTC (permalink / raw)
  To: u-boot

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>
---
Changes for v2:
	- Changed patch heading
	- Changed patch commit message

 drivers/usb/host/ehci-fsl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH][v2] fsl/usb: Limit phy_type comparison to first four characters
  2014-02-17 11:28 [U-Boot] [PATCH][v2] fsl/usb: Limit phy_type comparison to first four characters Nikhil Badola
@ 2014-02-24 23:58 ` York Sun
  0 siblings, 0 replies; 2+ messages in thread
From: York Sun @ 2014-02-24 23:58 UTC (permalink / raw)
  To: u-boot

On 02/17/2014 03:28 AM, Nikhil Badola wrote:
> 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>
> ---
> Changes for v2:
> 	- Changed patch heading
> 	- Changed patch commit message
> 

Applied to u-boot-mpc85xx/master. Thanks.

York

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-24 23:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-17 11:28 [U-Boot] [PATCH][v2] fsl/usb: Limit phy_type comparison to first four characters Nikhil Badola
2014-02-24 23:58 ` York Sun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.