patch-2.2.16 linux/drivers/char/ip2.c

Next file: linux/drivers/char/ip2main.c
Previous file: linux/drivers/char/ip2/ip2trace.h
Back to the patch index
Back to the overall index

diff -urN v2.2.15/linux/drivers/char/ip2.c linux/drivers/char/ip2.c
@@ -12,6 +12,16 @@
 #include <linux/module.h>
 #include <linux/init.h>
 
+#ifndef __init
+#define __init
+#endif
+#ifndef __initfunc
+#define __initfunc(a) a
+#endif
+#ifndef __initdata
+#define __initdata
+#endif
+
 #include "./ip2/ip2types.h"		
 #include "./ip2/fip_firm.h"		// the meat
 
@@ -19,15 +29,26 @@
 ip2_loadmain(int *, int  *, unsigned char *, int ); // ref into ip2main.c
 
 #ifdef MODULE
+
+#include <linux/autoconf.h>
+#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
+#	define MODVERSIONS
+#endif
+#ifdef MODVERSIONS
+#	include <linux/modversions.h>
+#endif
+
 static int io[IP2_MAX_BOARDS]= { 0,};
 static int irq[IP2_MAX_BOARDS] = { 0,}; 
 
-MODULE_AUTHOR("Doug McNash");
-MODULE_DESCRIPTION("Computone IntelliPort Plus Driver");
-MODULE_PARM(irq,"1-"__MODULE_STRING(IP2_MAX_BOARDS) "i");
-MODULE_PARM_DESC(irq,"Interrupts for IntelliPort Cards");
-MODULE_PARM(io,"1-"__MODULE_STRING(IP2_MAX_BOARDS) "i");
-MODULE_PARM_DESC(io,"I/O ports for IntelliPort Cards");
+#	if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+		MODULE_AUTHOR("Doug McNash");
+		MODULE_DESCRIPTION("Computone IntelliPort Plus Driver");
+		MODULE_PARM(irq,"1-"__MODULE_STRING(IP2_MAX_BOARDS) "i");
+		MODULE_PARM_DESC(irq,"Interrupts for IntelliPort Cards");
+		MODULE_PARM(io,"1-"__MODULE_STRING(IP2_MAX_BOARDS) "i");
+		MODULE_PARM_DESC(io,"I/O ports for IntelliPort Cards");
+#	endif	/* LINUX_VERSION */
 
 
 //======================================================================

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)