All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: rx6110: fix build against modular I2C
@ 2020-12-30 14:59 Arnd Bergmann
  2021-01-12 22:47 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-12-30 14:59 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Henning Schild, Claudius Heine
  Cc: Arnd Bergmann, linux-rtc, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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: afa819c2c6bf ("rtc: rx6110: add i2c support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/rtc/rtc-rx6110.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-rx6110.c b/drivers/rtc/rtc-rx6110.c
index a7b671a21022..79161d4c6ce4 100644
--- a/drivers/rtc/rtc-rx6110.c
+++ b/drivers/rtc/rtc-rx6110.c
@@ -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,
@@ -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,
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: rx6110: fix build against modular I2C
  2020-12-30 14:59 [PATCH] rtc: rx6110: fix build against modular I2C Arnd Bergmann
@ 2021-01-12 22:47 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2021-01-12 22:47 UTC (permalink / raw)
  To: Henning Schild, Arnd Bergmann, Claudius Heine, Alessandro Zummo
  Cc: Alexandre Belloni, linux-rtc, linux-kernel, Arnd Bergmann

On Wed, 30 Dec 2020 15:59:11 +0100, Arnd Bergmann wrote:
> 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.

Applied, thanks!

[1/1] rtc: rx6110: fix build against modular I2C
      commit: def8550f543e6c9101f3e1a03160b2aab8c02e8a

Best regards,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-12 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 14:59 [PATCH] rtc: rx6110: fix build against modular I2C Arnd Bergmann
2021-01-12 22:47 ` Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.