patch-2.1.33 linux/drivers/net/net_init.c

Next file: linux/drivers/net/plip.c
Previous file: linux/drivers/net/eepro100.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.32/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
@@ -318,7 +318,7 @@
 	save_flags(flags);
 	cli();
 
-	if (dev && dev->init) {
+	if (dev) {
 		if (dev->name &&
 			((dev->name[0] == '\0') || (dev->name[0] == ' '))) {
 			for (i = 0; i < MAX_ETH_CARDS; ++i)
@@ -330,13 +330,15 @@
 				}
 		}
 
-		sti();	/* device probes assume interrupts enabled */
-		if (dev->init(dev) != 0) {
+		if (dev->init) {
+		  sti();	/* device probes assume interrupts enabled */
+		  if (dev->init(dev) != 0) {
 		    if (i < MAX_ETH_CARDS) ethdev_index[i] = NULL;
 			restore_flags(flags);
 			return -EIO;
+		  }
+		  cli();
 		}
-		cli();
 
 		/* Add device to end of chain */
 		if (dev_base) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov