Skip to contentSkip to conversation

4/4 WIP I2C kernel patches-Makefile and necessary changes

PATCH New Albert Cranford 2 participants 2 messages May 19, 2005 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 4/4 WIP I2C kernel patches-Makefile and necessary changes

Patch 4 implements name changes in the Makefile and export necessary to get elektor.c and philips-par.c to compile inline. It also fixes compile error in algo-bit.c, renaming current->need_resched to need_resched.
It also fixes warning in elv.c and velleman.c if compiled as a module.

drivers/i2c/Makefile 2002-05-14 23:04:24.000000000 -0400 renamed from drivers/i2c/Makefile.orig 2002-05-09 18:21:38.000000000 -0400 +5 -5
@@ -5,16 +5,16 @@
 O_TARGET := i2c.o
 
 export-objs    := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \
-                  i2c-algo-ite.o i2c-proc.o
+                  i2c-algo-ite.o i2c-proc.o i2c-philips-par.o i2c-elektor.o
 
 obj-$(CONFIG_I2C)              += i2c-core.o
 obj-$(CONFIG_I2C_CHARDEV)      += i2c-dev.o
 obj-$(CONFIG_I2C_ALGOBIT)      += i2c-algo-bit.o
-obj-$(CONFIG_I2C_PHILIPSPAR)   += i2c-philips-par.o
-obj-$(CONFIG_I2C_ELV)          += i2c-elv.o
-obj-$(CONFIG_I2C_VELLEMAN)     += i2c-velleman.o
+obj-$(CONFIG_I2C_BITLP)        +=      i2c-philips-par.o
+obj-$(CONFIG_I2C_BITELV)       += i2c-elv.o
+obj-$(CONFIG_I2C_BITVELLE)     += i2c-velleman.o
 obj-$(CONFIG_I2C_ALGOPCF)      += i2c-algo-pcf.o
-obj-$(CONFIG_I2C_ELEKTOR)      += i2c-elektor.o
+obj-$(CONFIG_I2C_PCFISA)       += i2c-elektor.o
 obj-$(CONFIG_ITE_I2C_ALGO)     += i2c-algo-ite.o
 obj-$(CONFIG_ITE_I2C_ADAP)     += i2c-adap-ite.o
 obj-$(CONFIG_I2C_PROC)         += i2c-proc.o
drivers/i2c/i2c-elektor.c 2002-05-14 23:10:11.000000000 -0400 renamed from drivers/i2c/i2c-elektor.c.orig 2002-05-14 23:14:40.000000000 -0400 +1 -2
@@ -295,10 +295,9 @@
 
        return 0;
 }
+EXPORT_SYMBOL(i2c_pcfisa_init);
 
 
-EXPORT_NO_SYMBOLS;
-
 #ifdef MODULE
 MODULE_AUTHOR("Hans Berglund <[email protected]>");
 MODULE_DESCRIPTION("I2C-Bus adapter routines for PCF8584 ISA bus adapter");
drivers/i2c/i2c-philips-par.c 2002-05-14 23:10:15.000000000 -0400 renamed from drivers/i2c/i2c-philips-par.c.orig 2002-05-14 23:14:40.000000000 -0400 +1 -2
@@ -277,6 +277,7 @@
        
        return 0;
 }
+EXPORT_SYMBOL(i2c_bitlp_init);
 
 void __exit i2c_bitlp_exit(void)
 {
@@ -289,8 +290,6 @@
 #endif
 }
 
-EXPORT_NO_SYMBOLS;
-
 MODULE_AUTHOR("Simon G. Vogl <[email protected]>");
 MODULE_DESCRIPTION("I2C-Bus adapter routines for Philips parallel port adapter");
 #ifdef MODULE_LICENSE
drivers/i2c/i2c-algo-bit.c 2002-05-15 00:55:28.000000000 -0400 renamed from drivers/i2c/i2c-algo-bit.c.orig 2002-05-15 00:50:12.000000000 -0400 +1 -2
@@ -119,8 +119,7 @@
                if (start+adap->timeout <= jiffies) {
                        return -ETIMEDOUT;
                }
-               if (current->need_resched)
-                       schedule();
+               if (need_resched) schedule();
        }
        DEBSTAT(printk(KERN_DEBUG "needed %ld jiffies\n", jiffies-start));
 #ifdef SLO_IO
drivers/i2c/i2c-elv.c 2002-05-15 00:59:30.000000000 -0400 renamed from drivers/i2c/i2c-elv.c.orig 2002-05-15 00:59:01.000000000 -0400 +2 -0
@@ -113,10 +113,12 @@
        return 0;
 }
 
+#ifdef MODULE
 static void bit_elv_exit(void)
 {
        release_region( base , (base = 0x3bc)? 3 : 8 );
 }
+#endif
 
 static int bit_elv_reg(struct i2c_client *client)
 {
drivers/i2c/i2c-velleman.c 2002-05-15 01:01:20.000000000 -0400 renamed from drivers/i2c/i2c-velleman.c.orig 2002-05-15 01:00:52.000000000 -0400 +2 -0
@@ -102,10 +102,12 @@
        return 0;
 }
 
+#ifdef MODULE
 static void bit_velle_exit(void)
 {      
        release_region( base , (base = 0x3bc)? 3 : 8 );
 }
+#endif
 
 
 static int bit_velle_reg(struct i2c_client *client)
Signature · 2 lines
Albert Cranford Deerfield Beach FL USA
[email protected]
#1 lore raw

PATCH 1/1 4/4 WIP I2C kernel patches-Makefile and necessary changes

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"albert" = Albert Cranford <[email protected]> writes:

albert> obj-$(CONFIG_I2C)              += i2c-core.o
albert> obj-$(CONFIG_I2C_CHARDEV)      += i2c-dev.o
albert> obj-$(CONFIG_I2C_ALGOBIT)      += i2c-algo-bit.o
albert> -obj-$(CONFIG_I2C_PHILIPSPAR)   += i2c-philips-par.o
albert> -obj-$(CONFIG_I2C_ELV)          += i2c-elv.o
albert> -obj-$(CONFIG_I2C_VELLEMAN)     += i2c-velleman.o
albert> +obj-$(CONFIG_I2C_BITLP)        +=      i2c-philips-par.o
albert> +obj-$(CONFIG_I2C_BITELV)       += i2c-elv.o
albert> +obj-$(CONFIG_I2C_BITVELLE)     += i2c-velleman.o
albert> obj-$(CONFIG_I2C_ALGOPCF)      += i2c-algo-pcf.o
albert> -obj-$(CONFIG_I2C_ELEKTOR)      += i2c-elektor.o
albert> +obj-$(CONFIG_I2C_PCFISA)       += i2c-elektor.o
albert> obj-$(CONFIG_ITE_I2C_ALGO)     += i2c-algo-ite.o
albert> obj-$(CONFIG_ITE_I2C_ADAP)     += i2c-adap-ite.o
albert> obj-$(CONFIG_I2C_PROC)         += i2c-proc.o

Merge this with the config.in changes.

albert> --- linux/drivers/i2c/i2c-algo-bit.c.orig 2002-05-15 00:50:12.000000000 -0400
albert> +++ linux/drivers/i2c/i2c-algo-bit.c 2002-05-15 00:55:28.000000000 -0400
albert> @@ -119,8 +119,7 @@
albert> if (start+adap->timeout <= jiffies) {
albert> return -ETIMEDOUT;
albert> }
albert> - if (current->need_resched)
albert> - schedule();
albert> + if (need_resched) schedule();
albert> }
albert> DEBSTAT(printk(KERN_DEBUG "needed %ld jiffies\n", jiffies-start)); albert> #ifdef SLO_IO

Better put cond_resched(), that way it works in 2.4 & 2.5.

albert> --- linux/drivers/i2c/i2c-elv.c.orig 2002-05-15 00:59:01.000000000 -0400
albert> +++ linux/drivers/i2c/i2c-elv.c 2002-05-15 00:59:30.000000000 -0400 albert> @@ -113,10 +113,12 @@
albert> return 0;
albert> }

albert> +#ifdef MODULE
albert> static void bit_elv_exit(void)
albert> {
albert> release_region( base , (base = 0x3bc)? 3 : 8 ); albert> }
albert> +#endif

albert> static int bit_elv_reg(struct i2c_client *client) albert> {
albert> --- linux/drivers/i2c/i2c-velleman.c.orig 2002-05-15 01:00:52.000000000 -0400
albert> +++ linux/drivers/i2c/i2c-velleman.c 2002-05-15 01:01:20.000000000 -0400
albert> @@ -102,10 +102,12 @@
albert> return 0;
albert> }

albert> +#ifdef MODULE
albert> static void bit_velle_exit(void) albert> {
albert> release_region( base , (base = 0x3bc)? 3 : 8 ); albert> }
albert> +#endif

Marking that __exit will not be enough, instead of putting it inside #ifdefs?

Later, Juan.

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy