[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <AA75D6CD-4BEA-4189-AFA9-4111D77804B9@freescale.com>
Date: Mon, 29 Sep 2008 18:30:28 -0500
From: Andy Fleming <afleming@...escale.com>
To: Lennert Buytenhek <buytenh@...tstofly.org>
Cc: netdev@...r.kernel.org, Byron Bradley <byron.bbradley@...il.com>,
Jesper Dangaard Brouer <jdb@...x.dk>,
Tim Ellis <tim.ellis@....com>, Imre Kaloz <kaloz@...nwrt.org>,
Nicolas Pitre <nico@....org>, Dirk Teurlings <dirk@...xia.nl>,
Peter van Valderen <p.v.valderen@...il.com>
Subject: Re: [PATCH 1/6] phylib: add mdiobus_{read,write}
On Sep 28, 2008, at 21:37, Lennert Buytenhek wrote:
> Add mdiobus_{read,write} routines to allow direct reading/writing
> of registers on an mii bus without having to go through the PHY
> abstraction, and make phy_{read,write} use these primitives.
>
> Signed-off-by: Lennert Buytenhek <buytenh@...vell.com>
Looks pretty good. I was actually just thinking this might be handy
for some code we're working on.
Just one comment...
>
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -68,16 +68,7 @@ EXPORT_SYMBOL(phy_print_status);
> */
> int phy_read(struct phy_device *phydev, u16 regnum)
> {
> - int retval;
> - struct mii_bus *bus = phydev->bus;
> -
> - BUG_ON(in_interrupt());
> -
> - mutex_lock(&bus->mdio_lock);
> - retval = bus->read(bus, phydev->addr, regnum);
> - mutex_unlock(&bus->mdio_lock);
> -
> - return retval;
> + return mdiobus_read(phydev->bus, phydev->addr, regnum);
> }
> EXPORT_SYMBOL(phy_read);
I agree with Trent. Move these into phy.h and make them static inline
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists