Disabling module support breaks pci-scan.c

Ambrose Li <[email protected]> Thu, 03 Jul 2003 18:17:30 -0400
Newsgroups gmane.linux.drivers.eepro100.devel,gmane.linux.drivers.eepro100.user
Organization Chinese Cultural Centre of Greater Toronto
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------070703040108020604010108
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

When module support is completely disabled in the kernel (2.2.25),
pci-scan v 1.11 cannot be compiled. Error message follows; Patch
attached.

make[3]: Entering directory `/usr/src/linux-2.2.25/drivers/net'
cc -D__KERNEL__ -I/usr/src/linux-2.2.25/include -Wall 
-Wstrict-prototypes -O2 -f
omit-frame-pointer -fno-strict-aliasing -D__SMP__ -pipe 
-fno-strength-reduce -m4
86 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686   -c -o 
pci-sca
n.o pci-scan.c
pci-scan.c:53:31: linux/modversions.h: No such file or directory
pci-scan.c:59:31: linux/modversions.h: No such file or directory
pci-scan.c:587: warning: `handle_apm_event' defined but not use
make[3]: *** [pci-scan.o] Error 1
make[3]: Leaving directory `/usr/src/linux-2.2.25/drivers/net'
make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/usr/src/linux-2.2.25/drivers/net'
make[1]: *** [_subdir_net] Error 2
make[1]: Leaving directory `/usr/src/linux-2.2.25/drivers'
make: *** [_dir_drivers] Error 2

--------------070703040108020604010108
Content-Type: text/plain;
 name="pci-scan.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="pci-scan.c.patch"

--- pci-scan.c.orig	Tue Sep 24 00:08:48 2002
+++ pci-scan.c	Thu Jul  3 18:12:24 2003
@@ -50,6 +50,7 @@
 #endif
 
 #include <linux/version.h>
+#ifdef MODVERSIONS
 #include <linux/modversions.h>
 #if LINUX_VERSION_CODE < 0x20500  &&  defined(MODVERSIONS)
 /* Another interface semantics screw-up. */
@@ -59,6 +60,7 @@
 #include <linux/modversions.h>
 #include <linux/module.h>
 #endif
+#endif
 
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -274,7 +276,9 @@
 	if (((drv_id->flags & PCI_HOTSWAP)
 		 && register_hotswap_hook && (*register_hotswap_hook)(drv_id) == 0)
 		|| cards_found) {
+#ifdef MODVERSIONS
 		MOD_INC_USE_COUNT;
+#endif
 		drv_id->next = drv_list;
 		drv_list = drv_id;
 		return 0;
@@ -437,7 +441,9 @@
 	for (drvp = &drv_list; *drvp; drvp = &(*drvp)->next)
 		if (*drvp == drv_id) {
 			*drvp = (*drvp)->next;
+#ifdef MODVERSIONS
 			MOD_DEC_USE_COUNT;
+#endif
 			break;
 		}
 	while (*devip) {

--------------070703040108020604010108--