diff options
author | Lennert Buytenhek <buytenh@marvell.com> | 2008-10-09 12:45:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-09 12:45:04 -0400 |
commit | ec2a5652ea53c102306f08cdf516f98e32bd4b61 (patch) | |
tree | eb4aaee0455d2627556a830e4b491e7bba95bb87 /drivers/net/phy | |
parent | 724f88057609c00d6e973c3a7e0eb72f8eec2da9 (diff) |
phylib: two dynamic mii_bus allocation fallout fixes
1. arch/powerpc/platforms/pasemi/gpio_mdio.c also needs to be
converted over to mdiobus_{alloc,free}().
2. drivers/net/phy/fixed.c used to embed a struct mii_bus into its
struct fixed_mdio_bus and then use container_of() to go from the
former to the latter. Since mii bus structures are no longer
embedded, we need to do something like use the mii bus private
pointer to go from mii_bus to fixed_mdio_bus instead.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/fixed.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c index b5e13f8d5e31..cf24cc34debe 100644 --- a/drivers/net/phy/fixed.c +++ b/drivers/net/phy/fixed.c | |||
@@ -115,8 +115,7 @@ static int fixed_phy_update_regs(struct fixed_phy *fp) | |||
115 | 115 | ||
116 | static int fixed_mdio_read(struct mii_bus *bus, int phy_id, int reg_num) | 116 | static int fixed_mdio_read(struct mii_bus *bus, int phy_id, int reg_num) |
117 | { | 117 | { |
118 | struct fixed_mdio_bus *fmb = container_of(bus, struct fixed_mdio_bus, | 118 | struct fixed_mdio_bus *fmb = bus->priv; |
119 | mii_bus); | ||
120 | struct fixed_phy *fp; | 119 | struct fixed_phy *fp; |
121 | 120 | ||
122 | if (reg_num >= MII_REGS_NUM) | 121 | if (reg_num >= MII_REGS_NUM) |
@@ -221,6 +220,7 @@ static int __init fixed_mdio_bus_init(void) | |||
221 | 220 | ||
222 | snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "0"); | 221 | snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "0"); |
223 | fmb->mii_bus->name = "Fixed MDIO Bus"; | 222 | fmb->mii_bus->name = "Fixed MDIO Bus"; |
223 | fmb->mii_bus->priv = fmb; | ||
224 | fmb->mii_bus->parent = &pdev->dev; | 224 | fmb->mii_bus->parent = &pdev->dev; |
225 | fmb->mii_bus->read = &fixed_mdio_read; | 225 | fmb->mii_bus->read = &fixed_mdio_read; |
226 | fmb->mii_bus->write = &fixed_mdio_write; | 226 | fmb->mii_bus->write = &fixed_mdio_write; |