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

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

diff -u --recursive --new-file v1.3.15/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
@@ -314,33 +314,37 @@
 
 	printk("unregister_netdev: device ");
 
-	if (dev == NULL) {
+	if (dev == NULL) 
+	{
 		printk("was NULL\n");
 		restore_flags(flags);
 		return;
 	}
 	/* else */
 	if (dev->start)
-		printk("'%s' busy\n", dev->name);
-	else {
-		if (dev_base == dev)
-			dev_base = dev->next;
-		else {
-			while (d && (d->next != dev))
-				d = d->next;
-
-			if (d && (d->next == dev)) {
-				d->next = dev->next;
-				printk("'%s' unlinked\n", dev->name);
-			}
-			else {
-				printk("'%s' not found\n", dev->name);
-				restore_flags(flags);
-				return;
-			}
+		printk("ERROR '%s' busy and not MOD_IN_USE.\n", dev->name);
+	if (dev_base == dev)
+		dev_base = dev->next;
+	else 
+	{
+		while (d && (d->next != dev))
+			d = d->next;
+			
+		if (d && (d->next == dev)) 
+		{
+			d->next = dev->next;
+			printk("'%s' unlinked\n", dev->name);
 		}
-		for (i = 0; i < MAX_ETH_CARDS; ++i) {
-			if (ethdev_index[i] == dev) {
+		else 
+		{
+			printk("'%s' not found\n", dev->name);
+			restore_flags(flags);
+			return;
+		}
+		for (i = 0; i < MAX_ETH_CARDS; ++i) 
+		{
+			if (ethdev_index[i] == dev) 
+			{
 				ethdev_index[i] = NULL;
 				break;
 			}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this