Commit 44c7e9f8 authored by David S. Miller's avatar David S. Miller

[NET]: Convert PPC 8xx_io/fec.c away from init_etherdev().

parent eda60420
...@@ -1570,7 +1570,7 @@ int __init fec_enet_init(void) ...@@ -1570,7 +1570,7 @@ int __init fec_enet_init(void)
{ {
struct net_device *dev; struct net_device *dev;
struct fec_enet_private *fep; struct fec_enet_private *fep;
int i, j, k; int i, j, k, err;
unsigned char *eap, *iap, *ba; unsigned char *eap, *iap, *ba;
unsigned long mem_addr; unsigned long mem_addr;
volatile cbd_t *bdp; volatile cbd_t *bdp;
...@@ -1586,17 +1586,11 @@ int __init fec_enet_init(void) ...@@ -1586,17 +1586,11 @@ int __init fec_enet_init(void)
bd = (bd_t *)__res; bd = (bd_t *)__res;
/* Allocate some private information. dev = alloc_etherdev(sizeof(*fep));
*/ if (!dev)
fep = (struct fec_enet_private *)kmalloc(sizeof(*fep), GFP_KERNEL);
if (fep == NULL)
return -ENOMEM; return -ENOMEM;
__clear_user(fep,sizeof(*fep)); fep = dev->priv;
/* Create an Ethernet device instance.
*/
dev = init_etherdev(0, 0);
fecp = &(immap->im_cpm.cp_fec); fecp = &(immap->im_cpm.cp_fec);
...@@ -1661,6 +1655,7 @@ int __init fec_enet_init(void) ...@@ -1661,6 +1655,7 @@ int __init fec_enet_init(void)
/* Allocate a page. /* Allocate a page.
*/ */
ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr);
/* BUG: no check for failure */
/* Initialize the BD for every fragment in the page. /* Initialize the BD for every fragment in the page.
*/ */
...@@ -1715,7 +1710,6 @@ int __init fec_enet_init(void) ...@@ -1715,7 +1710,6 @@ int __init fec_enet_init(void)
#endif #endif
dev->base_addr = (unsigned long)fecp; dev->base_addr = (unsigned long)fecp;
dev->priv = fep;
/* The FEC Ethernet specific entries in the device structure. */ /* The FEC Ethernet specific entries in the device structure. */
dev->open = fec_enet_open; dev->open = fec_enet_open;
...@@ -1752,6 +1746,12 @@ int __init fec_enet_init(void) ...@@ -1752,6 +1746,12 @@ int __init fec_enet_init(void)
fecp->fec_mii_speed = 0; /* turn off MDIO */ fecp->fec_mii_speed = 0; /* turn off MDIO */
#endif /* CONFIG_USE_MDIO */ #endif /* CONFIG_USE_MDIO */
err = register_netdev(dev);
if (err) {
kfree(dev);
return err;
}
printk ("%s: FEC ENET Version 0.2, FEC irq %d" printk ("%s: FEC ENET Version 0.2, FEC irq %d"
#ifdef PHY_INTERRUPT #ifdef PHY_INTERRUPT
", MII irq %d" ", MII irq %d"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment