patch-2.4.0-test11 linux/drivers/net/atp.c
Next file: linux/drivers/net/bagetlance.c
Previous file: linux/drivers/net/atarilance.c
Back to the patch index
Back to the overall index
- Lines: 54
- Date:
Thu Nov 16 12:51:28 2000
- Orig file:
v2.4.0-test10/linux/drivers/net/atp.c
- Orig date:
Sun Oct 8 10:50:19 2000
diff -u --recursive --new-file v2.4.0-test10/linux/drivers/net/atp.c linux/drivers/net/atp.c
@@ -46,9 +46,9 @@
#define NUM_UNITS 2
/* The standard set of ISA module parameters. */
-static int io[NUM_UNITS] = {0, 0};
-static int irq[NUM_UNITS] = {0, 0};
-static int xcvr[NUM_UNITS] = {0, 0}; /* The data transfer mode. */
+static int io[NUM_UNITS];
+static int irq[NUM_UNITS];
+static int xcvr[NUM_UNITS]; /* The data transfer mode. */
/* Operational parameters that are set at compile time. */
@@ -292,6 +292,7 @@
dev = init_etherdev(dev, sizeof(struct net_local));
if (!dev)
return -ENOMEM;
+ SET_MODULE_OWNER(dev);
/* Find the IRQ used by triggering an interrupt. */
write_reg_byte(ioaddr, CMR2, 0x01); /* No accept mode, IRQ out. */
@@ -425,16 +426,14 @@
static int net_open(struct net_device *dev)
{
struct net_local *lp = (struct net_local *)dev->priv;
-
- MOD_INC_USE_COUNT;
+ int ret;
/* The interrupt line is turned off (tri-stated) when the device isn't in
use. That's especially important for "attached" interfaces where the
port or interrupt may be shared. */
- if (request_irq(dev->irq, &atp_interrupt, 0, "ATP Ethernet", dev)) {
- MOD_DEC_USE_COUNT;
- return -EAGAIN;
- }
+ ret = request_irq(dev->irq, &atp_interrupt, 0, dev->name, dev);
+ if (ret)
+ return ret;
hardware_init(dev);
@@ -835,10 +834,7 @@
free_irq(dev->irq, dev);
/* Reset the ethernet hardware and activate the printer pass-through. */
- write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX);
-
- MOD_DEC_USE_COUNT;
-
+ write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX);
return 0;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)