i2c: gxp: fix build failure without CONFIG_I2C_SLAVE
authorArnd Bergmann <arnd@arndb.de>
Mon, 3 Apr 2023 07:49:13 +0000 (09:49 +0200)
committerWolfram Sang <wsa@kernel.org>
Wed, 3 May 2023 15:27:29 +0000 (17:27 +0200)
commit5d388143fa6c351d985ffd23ea50c91c8839141b
treeb0db18ec65daa51a10d1c6a6dd2905391fc81b7d
parentfa39065833dbdb2059ffe25d071e722c31fbbb6c
i2c: gxp: fix build failure without CONFIG_I2C_SLAVE

The gxp_i2c_slave_irq_handler() is hidden in an #ifdef, but the
caller uses an IS_ENABLED() check:

drivers/i2c/busses/i2c-gxp.c: In function 'gxp_i2c_irq_handler':
drivers/i2c/busses/i2c-gxp.c:467:29: error: implicit declaration of function 'gxp_i2c_slave_irq_handler'; did you mean 'gxp_i2c_irq_handler'? [-Werror=implicit-function-declaration]

It has to consistently use one method or the other to avoid warnings,
so move to IS_ENABLED() here for readability and build coverage, and
move the #ifdef in linux/i2c.h to allow building it as dead code.

Fixes: 4a55ed6f89f5 ("i2c: Add GXP SoC I2C Controller")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nick Hawkins <nick.hawkins@hpe.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-gxp.c
include/linux/i2c.h