diff options
-rw-r--r-- | arch/powerpc/platforms/pasemi/gpio_mdio.c | 4 | ||||
-rw-r--r-- | drivers/net/phy/fixed.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index 798c7abe160..75cc165d5be 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c | |||
@@ -230,7 +230,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, | |||
230 | if (!priv) | 230 | if (!priv) |
231 | goto out; | 231 | goto out; |
232 | 232 | ||
233 | new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); | 233 | new_bus = mdiobus_alloc(); |
234 | 234 | ||
235 | if (!new_bus) | 235 | if (!new_bus) |
236 | goto out_free_priv; | 236 | goto out_free_priv; |
@@ -306,7 +306,7 @@ static int gpio_mdio_remove(struct of_device *dev) | |||
306 | 306 | ||
307 | kfree(bus->priv); | 307 | kfree(bus->priv); |
308 | bus->priv = NULL; | 308 | bus->priv = NULL; |
309 | kfree(bus); | 309 | mdiobus_free(bus); |
310 | 310 | ||
311 | return 0; | 311 | return 0; |
312 | } | 312 | } |
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c index b5e13f8d5e3..cf24cc34deb 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; |