[PATCH -next] extcon: fix fsa9480 Kconfig warning and build errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

Fix Kconfig dependency warning and subsequent build errors caused by
the Kconfig entry for EXTCON-FSA9480.  It should not select
REGMAP_I2C unless I2C is already set/enabled.

WARNING: unmet direct dependencies detected for REGMAP_I2C
  Depends on [n]: I2C [=n]
  Selected by [y]:
  - EXTCON_FSA9480 [=y] && EXTCON [=y] && INPUT [=y]

../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_smbus_byte_reg_read’:
../drivers/base/regmap/regmap-i2c.c:25:2: error: implicit declaration of function ‘i2c_smbus_read_byte_data’ [-Werror=implicit-function-declaration]
  ret = i2c_smbus_read_byte_data(i2c, reg);
  ^
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_smbus_byte_reg_write’:
../drivers/base/regmap/regmap-i2c.c:43:2: error: implicit declaration of function ‘i2c_smbus_write_byte_data’ [-Werror=implicit-function-declaration]
  return i2c_smbus_write_byte_data(i2c, reg, val);
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_smbus_word_reg_read’:
../drivers/base/regmap/regmap-i2c.c:61:2: error: implicit declaration of function ‘i2c_smbus_read_word_data’ [-Werror=implicit-function-declaration]
  ret = i2c_smbus_read_word_data(i2c, reg);
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_smbus_word_reg_write’:
../drivers/base/regmap/regmap-i2c.c:79:2: error: implicit declaration of function ‘i2c_smbus_write_word_data’ [-Werror=implicit-function-declaration]
  return i2c_smbus_write_word_data(i2c, reg, val);
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_smbus_word_read_swapped’:
../drivers/base/regmap/regmap-i2c.c:97:2: error: implicit declaration of function ‘i2c_smbus_read_word_swapped’ [-Werror=implicit-function-declaration]
  ret = i2c_smbus_read_word_swapped(i2c, reg);
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_smbus_word_write_swapped’:
../drivers/base/regmap/regmap-i2c.c:115:2: error: implicit declaration of function ‘i2c_smbus_write_word_swapped’ [-Werror=implicit-function-declaration]
  return i2c_smbus_write_word_swapped(i2c, reg, val);
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_i2c_write’:
../drivers/base/regmap/regmap-i2c.c:129:2: error: implicit declaration of function ‘i2c_master_send’ [-Werror=implicit-function-declaration]
  ret = i2c_master_send(i2c, data, count);
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_i2c_gather_write’:
../drivers/base/regmap/regmap-i2c.c:150:2: error: implicit declaration of function ‘i2c_check_functionality’ [-Werror=implicit-function-declaration]
  if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_NOSTART))
../drivers/base/regmap/regmap-i2c.c:163:2: error: implicit declaration of function ‘i2c_transfer’ [-Werror=implicit-function-declaration]
  ret = i2c_transfer(i2c->adapter, xfer, 2);
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_i2c_smbus_i2c_write’:
../drivers/base/regmap/regmap-i2c.c:218:2: error: implicit declaration of function ‘i2c_smbus_write_i2c_block_data’ [-Werror=implicit-function-declaration]
  return i2c_smbus_write_i2c_block_data(i2c, ((u8 *)data)[0], count,
../drivers/base/regmap/regmap-i2c.c: In function ‘regmap_i2c_smbus_i2c_read’:
../drivers/base/regmap/regmap-i2c.c:233:2: error: implicit declaration of function ‘i2c_smbus_read_i2c_block_data’ [-Werror=implicit-function-declaration]
  ret = i2c_smbus_read_i2c_block_data(i2c, ((u8 *)reg)[0], val_size, val);

../drivers/extcon/extcon-fsa9480.c: In function ‘fsa9480_module_init’:
../drivers/extcon/extcon-fsa9480.c:383:2: error: implicit declaration of function ‘i2c_add_driver’ [-Werror=implicit-function-declaration]
  return i2c_add_driver(&fsa9480_i2c_driver);
../drivers/extcon/extcon-fsa9480.c: In function ‘fsa9480_module_exit’:
../drivers/extcon/extcon-fsa9480.c:389:2: error: implicit declaration of function ‘i2c_del_driver’ [-Werror=implicit-function-declaration]
  i2c_del_driver(&fsa9480_i2c_driver);

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Tomasz Figa <tomasz.figa@xxxxxxxxx>
Cc: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx>
Cc: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>
---
Found in mmotm; applies to linux-next.

To extcon maintainers:  there are a few more extcon driver Kconfig
entries that seem to have this same problem of selecting REGMAP_I2C
without checking that I2C is set/enabled.

 drivers/extcon/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- mmotm-2019-0625-1620.orig/drivers/extcon/Kconfig
+++ mmotm-2019-0625-1620/drivers/extcon/Kconfig
@@ -39,7 +39,7 @@ config EXTCON_AXP288
 
 config EXTCON_FSA9480
 	tristate "FSA9480 EXTCON Support"
-	depends on INPUT
+	depends on INPUT && I2C
 	select IRQ_DOMAIN
 	select REGMAP_I2C
 	help





[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux