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/fs_enet/mii-fec.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/fs_enet/mii-fec.c')
-rw-r--r-- | drivers/net/fs_enet/mii-fec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c index 4d89a22317ac..28077cc1b949 100644 --- a/drivers/net/fs_enet/mii-fec.c +++ b/drivers/net/fs_enet/mii-fec.c | |||
@@ -128,7 +128,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev, | |||
128 | struct fec_info *fec; | 128 | struct fec_info *fec; |
129 | int ret = -ENOMEM, i; | 129 | int ret = -ENOMEM, i; |
130 | 130 | ||
131 | new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); | 131 | new_bus = mdiobus_alloc(); |
132 | if (!new_bus) | 132 | if (!new_bus) |
133 | goto out; | 133 | goto out; |
134 | 134 | ||
@@ -190,7 +190,7 @@ out_res: | |||
190 | out_fec: | 190 | out_fec: |
191 | kfree(fec); | 191 | kfree(fec); |
192 | out_mii: | 192 | out_mii: |
193 | kfree(new_bus); | 193 | mdiobus_free(new_bus); |
194 | out: | 194 | out: |
195 | return ret; | 195 | return ret; |
196 | } | 196 | } |
@@ -205,7 +205,7 @@ static int fs_enet_mdio_remove(struct of_device *ofdev) | |||
205 | kfree(bus->irq); | 205 | kfree(bus->irq); |
206 | iounmap(fec->fecp); | 206 | iounmap(fec->fecp); |
207 | kfree(fec); | 207 | kfree(fec); |
208 | kfree(bus); | 208 | mdiobus_free(bus); |
209 | 209 | ||
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |