* [PATCH net] net/davinci_emac: fix failing PHY connect attempts
@ 2012-04-23 22:06 Anatolij Gustschin
2012-04-24 4:44 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Anatolij Gustschin @ 2012-04-23 22:06 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller
PHY connect attempts fail if no PHY id is specified in the emac platform
data and another mdio bus has been registered before 'davinci_mdio' bus. In
this case when configuring the interface, there will be an attempt to
connect to already attached PHY on the previously registered mdio bus:
net eth1: PHY already attached
net eth1: could not connect to phy smsc911x-0:01
IP-Config: Failed to open eth1
IP-Config: Device `eth1' not found
Fix this by modifying match_first_device() to match first PHY device
on 'davinci_mdio' bus.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
drivers/net/ethernet/ti/davinci_emac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 174a334..08aff1a 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1511,7 +1511,7 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd)
static int match_first_device(struct device *dev, void *data)
{
- return 1;
+ return !strncmp(dev_name(dev), "davinci_mdio", 12);
}
/**
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net/davinci_emac: fix failing PHY connect attempts
2012-04-23 22:06 [PATCH net] net/davinci_emac: fix failing PHY connect attempts Anatolij Gustschin
@ 2012-04-24 4:44 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-04-24 4:44 UTC (permalink / raw)
To: agust; +Cc: netdev
From: Anatolij Gustschin <agust@denx.de>
Date: Tue, 24 Apr 2012 00:06:43 +0200
> PHY connect attempts fail if no PHY id is specified in the emac platform
> data and another mdio bus has been registered before 'davinci_mdio' bus. In
> this case when configuring the interface, there will be an attempt to
> connect to already attached PHY on the previously registered mdio bus:
>
> net eth1: PHY already attached
> net eth1: could not connect to phy smsc911x-0:01
> IP-Config: Failed to open eth1
> IP-Config: Device `eth1' not found
>
> Fix this by modifying match_first_device() to match first PHY device
> on 'davinci_mdio' bus.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-24 4:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-23 22:06 [PATCH net] net/davinci_emac: fix failing PHY connect attempts Anatolij Gustschin
2012-04-24 4:44 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).