diff options
author | Lennert Buytenhek <buytenh@marvell.com> | 2008-10-08 23:29:57 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 23:29:57 (GMT) |
commit | 298cf9beb9679522de995e249eccbd82f7c51999 (patch) | |
tree | cabbc9c696a063982aea9a24d8caa667daa33a1a /drivers/net/gianfar_mii.c | |
parent | 18ee49ddb0d242ed1d0e273038d5e4f6de7379d3 (diff) | |
download | linux-fsl-qoriq-298cf9beb9679522de995e249eccbd82f7c51999.tar.xz |
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/gianfar_mii.c')
-rw-r--r-- | drivers/net/gianfar_mii.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c index 38895b0..bf73eea 100644 --- a/drivers/net/gianfar_mii.c +++ b/drivers/net/gianfar_mii.c @@ -164,8 +164,7 @@ static int gfar_mdio_probe(struct device *dev) if (NULL == dev) return -EINVAL; - new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); - + new_bus = mdiobus_alloc(); if (NULL == new_bus) return -ENOMEM; @@ -242,7 +241,7 @@ static int gfar_mdio_probe(struct device *dev) bus_register_fail: iounmap(regs); reg_map_fail: - kfree(new_bus); + mdiobus_free(new_bus); return err; } @@ -258,7 +257,7 @@ static int gfar_mdio_remove(struct device *dev) iounmap((void __iomem *)bus->priv); bus->priv = NULL; - kfree(bus); + mdiobus_free(bus); return 0; } |