diff options
| author | David S. Miller <davem@nuts.ninka.net> | 2003-06-03 13:51:42 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-06-03 13:51:42 -0700 |
| commit | 86fa60e5906305bf9088cc7deda64b8332b57b96 (patch) | |
| tree | 5f0d62f73d9d999e95fa013ad29c5d02aacc9eca | |
| parent | 760bebe12514fa33a4724c3eabb7cc996c4b1507 (diff) | |
[NET]: Convert PPC 8260_io/fcc_enet.c away from init_etherdev().
| -rw-r--r-- | arch/ppc/8260_io/fcc_enet.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c index 85274b8ac41e..8c357227e2e3 100644 --- a/arch/ppc/8260_io/fcc_enet.c +++ b/arch/ppc/8260_io/fcc_enet.c @@ -1328,7 +1328,7 @@ int __init fec_enet_init(void) struct net_device *dev; struct fcc_enet_private *cep; fcc_info_t *fip; - int i, np; + int i, np, err; volatile immap_t *immap; volatile iop8260_t *io; @@ -1339,15 +1339,11 @@ int __init fec_enet_init(void) fip = fcc_ports; while (np-- > 0) { - - /* Allocate some private information. - */ - cep = (struct fcc_enet_private *) - kmalloc(sizeof(*cep), GFP_KERNEL); - if (cep == NULL) + dev = alloc_etherdev(sizeof(*cep)); + if (!dev) return -ENOMEM; - __clear_user(cep,sizeof(*cep)); + cep = dev->priv; spin_lock_init(&cep->lock); cep->fip = fip; @@ -1376,6 +1372,12 @@ int __init fec_enet_init(void) init_fcc_startup(fip, dev); + err = register_netdev(dev); + if (err) { + kfree(dev); + return err; + } + printk("%s: FCC ENET Version 0.3, ", dev->name); for (i=0; i<5; i++) printk("%02x:", dev->dev_addr[i]); |
