make ne2.c allocating the net_device's dynamically using the new ei_alloc_dev() function, ethdev_init() is killed. compile tested. --- 1.7/drivers/net/ne2.c Thu Nov 21 23:06:11 2002 +++ edited/ne2.c Sun Jun 29 21:36:43 2003 @@ -444,14 +444,6 @@ dev->base_addr = base_addr; - /* Allocate dev->priv and fill in 8390 specific dev fields. */ - if (ethdev_init(dev)) { - printk (" unable to get memory for dev->priv.\n"); - free_irq(dev->irq, dev); - retval = -ENOMEM; - goto out; - } - for(i = 0; i < ETHER_ADDR_LEN; i++) { printk(" %2.2x", SA_prom[i]); dev->dev_addr[i] = SA_prom[i]; @@ -736,7 +728,7 @@ #ifdef MODULE #define MAX_NE_CARDS 4 /* Max number of NE cards per module */ -static struct net_device dev_ne[MAX_NE_CARDS]; +static struct net_device *dev_ne[MAX_NE_CARDS]; static int io[MAX_NE_CARDS]; static int irq[MAX_NE_CARDS]; static int bad[MAX_NE_CARDS]; /* 0xbad = bad sig or no reset ack */ @@ -758,18 +750,26 @@ int this_dev, found = 0; for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { - struct net_device *dev = &dev_ne[this_dev]; + struct net_device *dev = ei_alloc_dev(); + if (!dev) { + /* free already found devices */ + cleanup_module(); + return -ENOMEM; + } + dev->irq = irq[this_dev]; dev->mem_end = bad[this_dev]; dev->base_addr = io[this_dev]; dev->init = ne2_probe; if (register_netdev(dev) != 0) { + kfree(dev); if (found != 0) return 0; /* Got at least one. */ printk(KERN_WARNING "ne2.c: No NE/2 card found.\n"); return -ENXIO; } found++; + dev_ne[this_dev] = dev; } return 0; } @@ -779,14 +779,14 @@ int this_dev; for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { - struct net_device *dev = &dev_ne[this_dev]; - if (dev->priv != NULL) { + struct net_device *dev = dev_ne[this_dev]; + if (dev) { mca_mark_as_unused(ei_status.priv); mca_set_adapter_procfn( ei_status.priv, NULL, NULL); - kfree(dev->priv); free_irq(dev->irq, dev); release_region(dev->base_addr, NE_IO_EXTENT); unregister_netdev(dev); + kfree(dev); } } } - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html