Skip to contentSkip to conversation

ac3200.c, ne3210.c, fmv18x.c & sis900.c check_region() removal

PATCH New Andrey Panin 1 participant 1 message Nov 3, 2000

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ac3200.c, ne3210.c, fmv18x.c & sis900.c check_region() removal

Hi all,

new check_region() removal patchset (for 2.4.0-test10) is here :)

Best regards,
Andrey

Signature · 2 lines
Andrey Panin 		| Embedded systems software engineer
[email protected]	| PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc
linux/drivers/net/ac3200.c renamed from mnt/disk/linux/drivers/net/ac3200.c +1 -4
diff -urN /mnt/disk/linux/drivers/net/ac3200.c /linux/drivers/net/ac3200.c
@@ -107,12 +107,9 @@
 	if ( ! EISA_bus)
 		return -ENXIO;
 
-	for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
-		if (check_region(ioaddr, AC_IO_EXTENT))
-			continue;
+	for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000)
 		if (ac_probe1(ioaddr, dev) == 0)
 			return 0;
-	}
 
 	return -ENODEV;
 }
linux/drivers/net/ne3210.c renamed from mnt/disk/linux/drivers/net/ne3210.c +29 -21

115 lines not on this page · raw message

linux/drivers/net/fmv18x.c renamed from mnt/disk/linux/drivers/net/fmv18x.c +24 -18

89 lines not on this page · raw message

linux/drivers/net/sis900.c renamed from mnt/disk/linux/drivers/net/sis900.c +9 -9
diff -urN /mnt/disk/linux/drivers/net/sis900.c /linux/drivers/net/sis900.c
@@ -62,7 +62,7 @@
 static int multicast_filter_limit = 128;
 
 #define sis900_debug debug
-static int sis900_debug = 0;
+static int sis900_debug;
 
 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT  (4*HZ)
@@ -172,6 +172,8 @@
 static void sis900_reset(struct net_device *net_dev);
 static void sis630e_set_eq(struct net_device *net_dev);
 
+#define SIS900_MODULE_NAME "sis900"
+
 /* walk through every ethernet PCI devices to see if some of them are matched with our card list*/
 static int __init sis900_probe (struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
 {
@@ -184,7 +186,7 @@
 	}
 
 	pci_io_base = pci_resource_start(pci_dev, 0);
-	if (check_region(pci_io_base, SIS900_TOTAL_SIZE)) {
+	if (!request_region(pci_io_base, SIS900_TOTAL_SIZE, SIS900_MODULE_NAME)) {
 		printk(KERN_ERR "sis900.c: can't allocate I/O space at 0x%08x\n",
 		       pci_io_base);
 		return -ENODEV;
@@ -192,14 +194,17 @@
 
 	/* setup various bits in PCI command register */
 	if (pci_enable_device (pci_dev))
-		return -ENODEV;
+		goto out;
 	pci_set_master(pci_dev);
 
 	/* do the real low level jobs */
 	if (sis900_mac_probe(pci_dev, card_names[pci_id->driver_data]) == NULL)
-		return -ENODEV;
+		goto out;
 
 	return 0;
+out:
+	release_region(pci_io_base, SIS900_TOTAL_SIZE);
+	return -ENODEV;
 }
 
 /* older SiS900 and friends, use EEPROM to store MAC address */
@@ -287,8 +292,6 @@
 	sis_priv = net_dev->priv;
 	memset(sis_priv, 0, sizeof(struct sis900_private));
 
-	/* We do a request_region() to register /proc/ioports info. */
-	request_region(ioaddr, SIS900_TOTAL_SIZE, net_dev->name);
 	net_dev->base_addr = ioaddr;
 	net_dev->irq = irq;
 	sis_priv->pci_dev = pci_dev;
@@ -298,7 +301,6 @@
 	if (sis900_mii_probe(net_dev) == 0) {
 		unregister_netdev(net_dev);
 		kfree(sis_priv);
-		release_region(ioaddr, SIS900_TOTAL_SIZE);
 		return NULL;
 	}
 
@@ -1442,8 +1444,6 @@
 	kfree(sis_priv);
 	kfree(net_dev);
 }
-
-#define SIS900_MODULE_NAME "sis900"
 
 static struct pci_driver sis900_pci_driver = {
 	name:		SIS900_MODULE_NAME,