diff options
author | Florian Fainelli <florian@openwrt.org> | 2009-08-04 06:52:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-05 15:20:57 -0400 |
commit | d76c626b922e279c7764ec46fb1b9bbd41538f35 (patch) | |
tree | 986ab4d02541db65c35888d851a8392f852fcfee /drivers/net/cpmac.c | |
parent | 36cbd3dcc10384f813ec0814255f576c84f2bcd4 (diff) |
cpmac: fix wrong MDIO bus identifier
This patch fixes the wrong MDIO bus identifier which was
set to 0 unconditionaly, suitable for external switches while
it is actually 1 for PHYs different than external switches
which are autodetected.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cpmac.c')
-rw-r--r-- | drivers/net/cpmac.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index fd5e32cbcb87..c951dd43f29b 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
@@ -1109,7 +1109,7 @@ static int external_switch; | |||
1109 | static int __devinit cpmac_probe(struct platform_device *pdev) | 1109 | static int __devinit cpmac_probe(struct platform_device *pdev) |
1110 | { | 1110 | { |
1111 | int rc, phy_id; | 1111 | int rc, phy_id; |
1112 | char *mdio_bus_id = "0"; | 1112 | char mdio_bus_id[BUS_ID_SIZE]; |
1113 | struct resource *mem; | 1113 | struct resource *mem; |
1114 | struct cpmac_priv *priv; | 1114 | struct cpmac_priv *priv; |
1115 | struct net_device *dev; | 1115 | struct net_device *dev; |
@@ -1127,7 +1127,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1127 | 1127 | ||
1128 | if (phy_id == PHY_MAX_ADDR) { | 1128 | if (phy_id == PHY_MAX_ADDR) { |
1129 | if (external_switch || dumb_switch) { | 1129 | if (external_switch || dumb_switch) { |
1130 | mdio_bus_id = 0; /* fixed phys bus */ | 1130 | strncpy(mdio_bus_id, "0", BUS_ID_SIZE); /* fixed phys bus */ |
1131 | phy_id = pdev->id; | 1131 | phy_id = pdev->id; |
1132 | } else { | 1132 | } else { |
1133 | dev_err(&pdev->dev, "no PHY present\n"); | 1133 | dev_err(&pdev->dev, "no PHY present\n"); |
@@ -1254,7 +1254,7 @@ int __devinit cpmac_init(void) | |||
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | cpmac_mii->phy_mask = ~(mask | 0x80000000); | 1256 | cpmac_mii->phy_mask = ~(mask | 0x80000000); |
1257 | snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "0"); | 1257 | snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "1"); |
1258 | 1258 | ||
1259 | res = mdiobus_register(cpmac_mii); | 1259 | res = mdiobus_register(cpmac_mii); |
1260 | if (res) | 1260 | if (res) |