diff options
author | Lennert Buytenhek <buytenh@marvell.com> | 2008-10-08 19:29:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 19:29:57 -0400 |
commit | 298cf9beb9679522de995e249eccbd82f7c51999 (patch) | |
tree | cabbc9c696a063982aea9a24d8caa667daa33a1a /drivers/net/ucc_geth_mii.c | |
parent | 18ee49ddb0d242ed1d0e273038d5e4f6de7379d3 (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/ucc_geth_mii.c')
-rw-r--r-- | drivers/net/ucc_geth_mii.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c index 75b72fe1f23c..c001d261366b 100644 --- a/drivers/net/ucc_geth_mii.c +++ b/drivers/net/ucc_geth_mii.c | |||
@@ -141,8 +141,7 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma | |||
141 | struct resource res; | 141 | struct resource res; |
142 | int k, err = 0; | 142 | int k, err = 0; |
143 | 143 | ||
144 | new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); | 144 | new_bus = mdiobus_alloc(); |
145 | |||
146 | if (NULL == new_bus) | 145 | if (NULL == new_bus) |
147 | return -ENOMEM; | 146 | return -ENOMEM; |
148 | 147 | ||
@@ -235,7 +234,7 @@ bus_register_fail: | |||
235 | ioremap_fail: | 234 | ioremap_fail: |
236 | kfree(new_bus->irq); | 235 | kfree(new_bus->irq); |
237 | reg_map_fail: | 236 | reg_map_fail: |
238 | kfree(new_bus); | 237 | mdiobus_free(new_bus); |
239 | 238 | ||
240 | return err; | 239 | return err; |
241 | } | 240 | } |
@@ -251,7 +250,7 @@ static int uec_mdio_remove(struct of_device *ofdev) | |||
251 | 250 | ||
252 | iounmap((void __iomem *)bus->priv); | 251 | iounmap((void __iomem *)bus->priv); |
253 | bus->priv = NULL; | 252 | bus->priv = NULL; |
254 | kfree(bus); | 253 | mdiobus_free(bus); |
255 | 254 | ||
256 | return 0; | 255 | return 0; |
257 | } | 256 | } |