[PATCH] phylib: Don't allow core of phylib to build as a module
Andy Fleming
afleming at freescale.com
Tue Jun 3 05:44:42 EST 2008
On Jun 2, 2008, at 14:30, Kumar Gala wrote:
>
> On Jun 2, 2008, at 11:39 AM, Jeff Garzik wrote:
>
> If you really think the core of the phylib should be able to be
> built as a module than we could possibly add function pointers to
> phy_dev to do the real phy_read()/phy_write() and change phy_read/
> _write to look like:
>
> int phy_read(struct phy_device *phydev, u16 regnum) {
> return phydev->read(phydev, regnum);
> }
That would be a bit silly, since this is the definition of phy_read():
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;
}
We could, of course, move phy_read *out* of the phylib module. And
also phy_register_fixup and any other functions needed by board code.
I'm partial to the select-it-if-you-need-it paradigm.
Andy
More information about the Linuxppc-dev
mailing list