• Arnd Bergmann's avatar
    i2c: gxp: fix build failure without CONFIG_I2C_SLAVE · 5d388143
    Arnd Bergmann authored
    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>
    5d388143
i2c-gxp.c 15.2 KB