aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet/mii-bitbang.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@marvell.com>2008-10-08 19:29:57 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-08 19:29:57 -0400
commit298cf9beb9679522de995e249eccbd82f7c51999 (patch)
treecabbc9c696a063982aea9a24d8caa667daa33a1a /drivers/net/fs_enet/mii-bitbang.c
parent18ee49ddb0d242ed1d0e273038d5e4f6de7379d3 (diff)
phylib: move to dynamic allocation of struct mii_bus
This patch introduces mdiobus_alloc() and mdiobus_free(), and makes all mdio bus drivers use these functions to allocate their struct mii_bus'es dynamically. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'drivers/net/fs_enet/mii-bitbang.c')
-rw-r--r--drivers/net/fs_enet/mii-bitbang.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/fs_enet/mii-bitbang.c b/drivers/net/fs_enet/mii-bitbang.c
index 2774252c2352..49b6645d7e0c 100644
--- a/drivers/net/fs_enet/mii-bitbang.c
+++ b/drivers/net/fs_enet/mii-bitbang.c
@@ -218,9 +218,9 @@ out_free_irqs:
218out_unmap_regs: 218out_unmap_regs:
219 iounmap(bitbang->dir); 219 iounmap(bitbang->dir);
220out_free_bus: 220out_free_bus:
221 kfree(new_bus);
222out_free_priv:
223 free_mdio_bitbang(new_bus); 221 free_mdio_bitbang(new_bus);
222out_free_priv:
223 kfree(bitbang);
224out: 224out:
225 return ret; 225 return ret;
226} 226}
@@ -231,12 +231,11 @@ static int fs_enet_mdio_remove(struct of_device *ofdev)
231 struct bb_info *bitbang = bus->priv; 231 struct bb_info *bitbang = bus->priv;
232 232
233 mdiobus_unregister(bus); 233 mdiobus_unregister(bus);
234 free_mdio_bitbang(bus);
235 dev_set_drvdata(&ofdev->dev, NULL); 234 dev_set_drvdata(&ofdev->dev, NULL);
236 kfree(bus->irq); 235 kfree(bus->irq);
236 free_mdio_bitbang(bus);
237 iounmap(bitbang->dir); 237 iounmap(bitbang->dir);
238 kfree(bitbang); 238 kfree(bitbang);
239 kfree(bus);
240 239
241 return 0; 240 return 0;
242} 241}