patch-2.3.99-pre6 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 -u --recursive --new-file v2.3.99-pre5/linux/drivers/char/ip2.c linux/drivers/char/ip2.c
@@ -6,11 +6,22 @@
 //  __initdata should work as advertized
 //
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/init.h>
 #include <linux/wait.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
 
@@ -18,15 +29,24 @@
 ip2_loadmain(int *, int  *, unsigned char *, int ); // ref into ip2main.c
 
 #ifdef MODULE
+#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)