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/fec_mpc52xx_phy.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/fec_mpc52xx_phy.c')
-rw-r--r-- | drivers/net/fec_mpc52xx_phy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c index 2a523308c77e..08e18bcb970f 100644 --- a/drivers/net/fec_mpc52xx_phy.c +++ b/drivers/net/fec_mpc52xx_phy.c | |||
@@ -83,7 +83,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of, const struct of_device_i | |||
83 | int err; | 83 | int err; |
84 | int i; | 84 | int i; |
85 | 85 | ||
86 | bus = kzalloc(sizeof(*bus), GFP_KERNEL); | 86 | bus = mdiobus_alloc(); |
87 | if (bus == NULL) | 87 | if (bus == NULL) |
88 | return -ENOMEM; | 88 | return -ENOMEM; |
89 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 89 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
@@ -150,7 +150,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of, const struct of_device_i | |||
150 | irq_dispose_mapping(bus->irq[i]); | 150 | irq_dispose_mapping(bus->irq[i]); |
151 | kfree(bus->irq); | 151 | kfree(bus->irq); |
152 | kfree(priv); | 152 | kfree(priv); |
153 | kfree(bus); | 153 | mdiobus_free(bus); |
154 | 154 | ||
155 | return err; | 155 | return err; |
156 | } | 156 | } |
@@ -171,7 +171,7 @@ static int mpc52xx_fec_mdio_remove(struct of_device *of) | |||
171 | irq_dispose_mapping(bus->irq[i]); | 171 | irq_dispose_mapping(bus->irq[i]); |
172 | kfree(priv); | 172 | kfree(priv); |
173 | kfree(bus->irq); | 173 | kfree(bus->irq); |
174 | kfree(bus); | 174 | mdiobus_free(bus); |
175 | 175 | ||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |