Jesper Nilsson wrote:
> static int
> e100_probe_transceiver(struct net_device* dev)
> {
> +#if !defined(CONFIG_ETRAX_NO_PHY)
> unsigned int phyid_high;
> unsigned int phyid_low;
> unsigned int oui;
> struct transceiver_ops* ops = NULL;
> + struct net_local *np = netdev_priv(dev);
> +
> + spin_lock(&np->transceiver_lock);
>
> /* Probe MDIO physical address */
> - for (mdio_phy_addr = 0; mdio_phy_addr <= 31; mdio_phy_addr++) {
> - if (e100_get_mdio_reg(dev, mdio_phy_addr, MII_BMSR) != 0xffff)
> + for (np->mii_if.phy_id = 0; np->mii_if.phy_id <= 31;
> + np->mii_if.phy_id++) {
> + if (e100_get_mdio_reg(dev,
> + np->mii_if.phy_id, MII_BMSR) != 0xffff)
> break;
> }
> - if (mdio_phy_addr == 32)
> + if (np->mii_if.phy_id == 32)
> return -ENODEV;
You need to unlock before this return.
>
> /* Get manufacturer */
> - phyid_high = e100_get_mdio_reg(dev, mdio_phy_addr, MII_PHYSID1);
> - phyid_low = e100_get_mdio_reg(dev, mdio_phy_addr, MII_PHYSID2);
> + phyid_high = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_PHYSID1);
> + phyid_low = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_PHYSID2);
> oui = (phyid_high << 6) | (phyid_low >> 10);
>
> for (ops = &transceivers[0]; ops->oui; ops++) {
> @@ -998,6 +912,8 @@
> }
> transceiver = ops;
>
> + spin_unlock(&np->transceiver_lock);
> +#endif
> return 0;
> }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]