From: Roel Kluin <12o3l@tiscali.nl>
To: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mikael Starvik <mikael.starvik@axis.com>,
linux-kernel@vger.kernel.org, jgarzik@pobox.com
Subject: Re: [PATCH 9/16] CRIS architecture: Correct compile errors
Date: Tue, 30 Oct 2007 16:32:35 +0100 [thread overview]
Message-ID: <47274E93.9030403@tiscali.nl> (raw)
In-Reply-To: <20071030093231.GL11960@axis.com>
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;
> }
next prev parent reply other threads:[~2007-10-30 15:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 9:32 [PATCH 9/16] CRIS architecture: Correct compile errors Jesper Nilsson
2007-10-30 15:32 ` Roel Kluin [this message]
2007-11-02 9:47 ` Jesper Nilsson
2007-10-30 22:14 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47274E93.9030403@tiscali.nl \
--to=12o3l@tiscali.nl \
--cc=akpm@linux-foundation.org \
--cc=jesper.nilsson@axis.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikael.starvik@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox