Skip to content

Commit

Permalink
rtc: rx6110: fix build against modular I2C
Browse files Browse the repository at this point in the history
[ Upstream commit def8550 ]

With CONFIG_I2C=m, the #ifdef section is disabled, as shown
by this warning:

drivers/rtc/rtc-rx6110.c:314:12: error: unused function 'rx6110_probe' [-Werror,-Wunused-function]

Change the driver to use IS_ENABLED() instead, which works
for both module and built-in subsystems.

Fixes: afa819c ("rtc: rx6110: add i2c support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201230145938.3254459-1-arnd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
arndb authored and gregkh committed Mar 4, 2021
1 parent 7edddd1 commit 649b59e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rtc/rtc-rx6110.c
Expand Up @@ -331,7 +331,7 @@ static int rx6110_probe(struct rx6110_data *rx6110, struct device *dev)
return 0;
}

#ifdef CONFIG_SPI_MASTER
#if IS_ENABLED(CONFIG_SPI_MASTER)
static struct regmap_config regmap_spi_config = {
.reg_bits = 8,
.val_bits = 8,
Expand Down Expand Up @@ -411,7 +411,7 @@ static void rx6110_spi_unregister(void)
}
#endif /* CONFIG_SPI_MASTER */

#ifdef CONFIG_I2C
#if IS_ENABLED(CONFIG_I2C)
static struct regmap_config regmap_i2c_config = {
.reg_bits = 8,
.val_bits = 8,
Expand Down

0 comments on commit 649b59e

Please sign in to comment.