patch-2.4.0-test11 linux/drivers/net/3c501.c
Next file: linux/drivers/net/3c503.c
Previous file: linux/drivers/mtd/map_ram.c
Back to the patch index
Back to the overall index
- Lines: 59
- Date:
Tue Nov 14 13:16:37 2000
- Orig file:
v2.4.0-test10/linux/drivers/net/3c501.c
- Orig date:
Tue Oct 31 12:42:26 2000
diff -u --recursive --new-file v2.4.0-test10/linux/drivers/net/3c501.c linux/drivers/net/3c501.c
@@ -234,7 +234,9 @@
int __init el1_probe(struct net_device *dev)
{
int i;
- int base_addr = dev ? dev->base_addr : 0;
+ int base_addr = dev->base_addr;
+
+ SET_MODULE_OWNER(dev);
if (base_addr > 0x1ff) /* Check a single specified location. */
return el1_probe1(dev, base_addr);
@@ -398,19 +400,16 @@
static int el_open(struct net_device *dev)
{
+ int retval;
int ioaddr = dev->base_addr;
struct net_local *lp = (struct net_local *)dev->priv;
unsigned long flags;
- MOD_INC_USE_COUNT;
-
if (el_debug > 2)
printk("%s: Doing el_open()...", dev->name);
- if (request_irq(dev->irq, &el_interrupt, 0, "3c501", dev)) {
- MOD_DEC_USE_COUNT;
- return -EAGAIN;
- }
+ if ((retval = request_irq(dev->irq, &el_interrupt, 0, dev->name, dev)))
+ return retval;
spin_lock_irqsave(&lp->lock, flags);
el_reset(dev);
@@ -862,7 +861,6 @@
free_irq(dev->irq, dev);
outb(AX_RESET, AX_CMD); /* Reset the chip */
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -916,12 +914,10 @@
#ifdef MODULE
-static struct net_device dev_3c501 =
-{
- "", /* device name is inserted by linux/drivers/net/net_init.c */
- 0, 0, 0, 0,
- 0x280, 5,
- 0, 0, 0, NULL, el1_probe
+static struct net_device dev_3c501 = {
+ init: el1_probe,
+ base_addr: 0x280,
+ irq: 5,
};
static int io=0x280;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)