2.4.0-test3-pre7 i2c compile errors

From: Thomas Molina (tmolina@home.com)
Date: Sun Jul 09 2000 - 08:08:48 EST


When I compiled subject kernel for the first time I got:

/mnt/hd/src/linux-2.4.0test/Rules.make:263: target `uart401.o' given more than once in the same rule.
/mnt/hd/src/linux-2.4.0test/Rules.make:263: target `uart401.o' given more than once in the same rule.
cc1: warnings being treated as errors
i2c-core.c: In function `i2c_init_all':
i2c-core.c:1153: warning: implicit declaration of function `i2c_algo_bit_init'
make[3]: *** [i2c-core.o] Error 1
make[2]: *** [first_rule] Error 2
make[1]: *** [_subdir_i2c] Error 2
make: *** [_dir_drivers] Error 2

which seems to be caused by the following code in i2c-core.c:

#ifndef MODULE
#ifdef CONFIG_I2C_CHARDEV
        extern int i2c_dev_init(void);
#endif
#ifdef CONFIG_I2C_ALGOBIT
        extern int algo_bit_init(void);
#endif
 
whereas when it is actually used later in the code it is:

#ifdef CONFIG_I2C_ALGOBIT
        i2c_algo_bit_init();
#endif

Changing the function prototype to add i2c_ to its declaration allows
things to compile and it seems to work correctly. I noticed other
function prototypes in the same section which seem to have the same
"problem". A quick perusal seems to indicate they need the same change.
As a result, I came up with the following patch. Could you all look at
it and see if it seems reasonable. The patch is against
2.4.0-test3-pre7.

--- linux/drivers/i2c/i2c-core.c.old Sun Jul 9 07:35:50 2000
+++ linux/drivers/i2c/i2c-core.c Sun Jul 9 07:54:12 2000
@@ -1115,26 +1115,26 @@
         extern int i2c_dev_init(void);
 #endif
 #ifdef CONFIG_I2C_ALGOBIT
- extern int algo_bit_init(void);
+ extern int i2c_algo_bit_init(void);
 #endif
 #ifdef CONFIG_I2C_BITLP
- extern int bitlp_init(void);
+ extern int i2c_bitlp_init(void);
 #endif
 #ifdef CONFIG_I2C_BITELV
- extern int bitelv_init(void);
+ extern int i2c_bitelv_init(void);
 #endif
 #ifdef CONFIG_I2C_BITVELLE
- extern int bitvelle_init(void);
+ extern int i2c_bitvelle_init(void);
 #endif
 #ifdef CONFIG_I2C_BITVIA
- extern int bitvia_init(void);
+ extern int i2c_bitvia_init(void);
 #endif
 
 #ifdef CONFIG_I2C_ALGOPCF
- extern int algo_pcf_init(void);
+ extern int i2c_algo_pcf_init(void);
 #endif
 #ifdef CONFIG_I2C_PCFISA
- extern int pcfisa_init(void);
+ extern int i2c_pcfisa_init(void);
 #endif
 
 /* This is needed for automatic patch generation: sensors code starts here */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:10 EST