Commit 633edf5a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

cris-build-fixes-update-eth_v10c-ethernet-driver-fix

Fix locking bug noted by  Roel Kluin <12o3l@tiscali.nl>.

Cc: Jeff Garzik <jeff@garzik.org>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bafef0ae
...@@ -1088,6 +1088,8 @@ e100_set_duplex(struct net_device* dev, enum duplex new_duplex) ...@@ -1088,6 +1088,8 @@ e100_set_duplex(struct net_device* dev, enum duplex new_duplex)
static int static int
e100_probe_transceiver(struct net_device* dev) e100_probe_transceiver(struct net_device* dev)
{ {
int ret = 0;
#if !defined(CONFIG_ETRAX_NO_PHY) #if !defined(CONFIG_ETRAX_NO_PHY)
unsigned int phyid_high; unsigned int phyid_high;
unsigned int phyid_low; unsigned int phyid_low;
...@@ -1104,8 +1106,10 @@ e100_probe_transceiver(struct net_device* dev) ...@@ -1104,8 +1106,10 @@ e100_probe_transceiver(struct net_device* dev)
np->mii_if.phy_id, MII_BMSR) != 0xffff) np->mii_if.phy_id, MII_BMSR) != 0xffff)
break; break;
} }
if (np->mii_if.phy_id == 32) if (np->mii_if.phy_id == 32) {
return -ENODEV; ret = -ENODEV;
goto out;
}
/* Get manufacturer */ /* Get manufacturer */
phyid_high = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_PHYSID1); phyid_high = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_PHYSID1);
...@@ -1117,10 +1121,10 @@ e100_probe_transceiver(struct net_device* dev) ...@@ -1117,10 +1121,10 @@ e100_probe_transceiver(struct net_device* dev)
break; break;
} }
transceiver = ops; transceiver = ops;
out:
spin_unlock(&np->transceiver_lock); spin_unlock(&np->transceiver_lock);
#endif #endif
return 0; return ret;
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment