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>
このコミットが含まれているのは:
Lennert Buytenhek
2008-10-08 16:29:57 -07:00
committed by David S. Miller
コミット 298cf9beb9
23個のファイルの変更285行の追加191行の削除

ファイルの表示

@@ -128,7 +128,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev,
struct fec_info *fec;
int ret = -ENOMEM, i;
new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
new_bus = mdiobus_alloc();
if (!new_bus)
goto out;
@@ -190,7 +190,7 @@ out_res:
out_fec:
kfree(fec);
out_mii:
kfree(new_bus);
mdiobus_free(new_bus);
out:
return ret;
}
@@ -205,7 +205,7 @@ static int fs_enet_mdio_remove(struct of_device *ofdev)
kfree(bus->irq);
iounmap(fec->fecp);
kfree(fec);
kfree(bus);
mdiobus_free(bus);
return 0;
}