Skip to content
Commit 5d388143 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Wolfram Sang
Browse files

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: 4a55ed6f

 ("i2c: Add GXP SoC I2C Controller")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarNick Hawkins <nick.hawkins@hpe.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent fa390658
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment