Commit 760bebe1 authored by David S. Miller's avatar David S. Miller

[NET]: Convert PPC 8260_io/enet.c away from init_etherdev().

parent 60c7e915
......@@ -630,19 +630,15 @@ int __init scc_enet_init(void)
bd = (bd_t *)__res;
/* Allocate some private information.
/* Create an Ethernet device instance.
*/
cep = (struct scc_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);
/* Create an Ethernet device instance.
*/
dev = init_etherdev(0, 0);
/* Get pointer to SCC area in parameter RAM.
*/
ep = (scc_enet_t *)(&immap->im_dprambase[PROFF_ENET]);
......@@ -771,6 +767,7 @@ int __init scc_enet_init(void)
/* Allocate a page.
*/
mem_addr = __get_free_page(GFP_KERNEL);
/* BUG: no check for failure */
/* Initialize the BD for every fragment in the page.
*/
......@@ -808,6 +805,7 @@ int __init scc_enet_init(void)
/* Install our interrupt handler.
*/
request_irq(SIU_INT_ENET, scc_enet_interrupt, 0, "enet", dev);
/* BUG: no check for failure */
/* Set GSMR_H to enable all normal operating modes.
* Set GSMR_L to enable Ethernet to MC68160.
......@@ -837,7 +835,6 @@ int __init scc_enet_init(void)
io->iop_pdatc |= PC_EST8260_ENET_NOTFD;
dev->base_addr = (unsigned long)ep;
dev->priv = cep;
/* The CPM Ethernet specific entries in the device structure. */
dev->open = scc_enet_open;
......@@ -852,6 +849,12 @@ int __init scc_enet_init(void)
*/
sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
err = register_netdev(dev);
if (err) {
kfree(dev);
return err;
}
printk("%s: SCC ENET Version 0.1, ", dev->name);
for (i=0; i<5; i++)
printk("%02x:", dev->dev_addr[i]);
......
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