[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47274E93.9030403@tiscali.nl>
Date: Tue, 30 Oct 2007 16:32:35 +0100
From: Roel Kluin <12o3l@...cali.nl>
To: Jesper Nilsson <jesper.nilsson@...s.com>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Mikael Starvik <mikael.starvik@...s.com>,
linux-kernel@...r.kernel.org, jgarzik@...ox.com
Subject: Re: [PATCH 9/16] CRIS architecture: Correct compile errors
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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists