diff options
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 38895b0e376d..bf73eea98010 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) | |||
164 | if (NULL == dev) | 164 | if (NULL == dev) |
165 | return -EINVAL; | 165 | return -EINVAL; |
166 | 166 | ||
167 | new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL); | 167 | new_bus = mdiobus_alloc(); |
168 | |||
169 | if (NULL == new_bus) | 168 | if (NULL == new_bus) |
170 | return -ENOMEM; | 169 | return -ENOMEM; |
171 | 170 | ||
@@ -242,7 +241,7 @@ static int gfar_mdio_probe(struct device *dev) | |||
242 | bus_register_fail: | 241 | bus_register_fail: |
243 | iounmap(regs); | 242 | iounmap(regs); |
244 | reg_map_fail: | 243 | reg_map_fail: |
245 | kfree(new_bus); | 244 | mdiobus_free(new_bus); |
246 | 245 | ||
247 | return err; | 246 | return err; |
248 | } | 247 | } |
@@ -258,7 +257,7 @@ static int gfar_mdio_remove(struct device *dev) | |||
258 | 257 | ||
259 | iounmap((void __iomem *)bus->priv); | 258 | iounmap((void __iomem *)bus->priv); |
260 | bus->priv = NULL; | 259 | bus->priv = NULL; |
261 | kfree(bus); | 260 | mdiobus_free(bus); |
262 | 261 | ||
263 | return 0; | 262 | return 0; |
264 | } | 263 | } |