Patchwork smc911x: Fix external PHY detection

login
register
mail settings
Submitter Guennadi Liakhovetski
Date Oct. 11, 2008, 9:10 p.m.
Message ID <Pine.LNX.4.64.0810112309410.4965@axis700.grange>
Download mbox | patch
Permalink /patch/4036/
State Accepted
Headers show

Comments

Guennadi Liakhovetski - Oct. 11, 2008, 9:10 p.m.
If an external PHY is found the driver falls through to the default
case in the switch and overwrites the PHY ID. Add the missing break.

Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
---
against 2.6.27

 drivers/net/smc911x.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
David Miller - Oct. 11, 2008, 10:07 p.m.
From: Guennadi Liakhovetski <lg@denx.de>
Date: Sat, 11 Oct 2008 23:10:58 +0200 (CEST)

> If an external PHY is found the driver falls through to the default
> case in the switch and overwrites the PHY ID. Add the missing break.
> 
> Signed-off-by: Guennadi Liakhovetski <lg@denx.de>

Applied, thanks.

> against 2.6.27

Luckily this still applied cleanly :)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Peter Korsgaard - Oct. 12, 2008, 7:43 a.m.
>>>>> "Guennadi" == Guennadi Liakhovetski <lg@denx.de> writes:

 Guennadi> If an external PHY is found the driver falls through to the
 Guennadi> default case in the switch and overwrites the PHY ID. Add
 Guennadi> the missing break.

 Guennadi> Signed-off-by: Guennadi Liakhovetski <lg@denx.de>

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>

Patch

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index c587162..dbc51e9 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -722,6 +722,9 @@  static void smc911x_phy_detect(struct net_device *dev)
 						break;
 					}
 				}
+				if (phyaddr < 32)
+					/* Found an external PHY */
+					break;
 			}
 		default:
 			/* Internal media only */