diff options
author | Bruno Thomsen <bruno.thomsen@gmail.com> | 2019-08-27 10:36:56 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-08-27 12:24:15 -0400 |
commit | 28abbba36a5a9f35bfaa75bf8ee0ebf2fe40b9e3 (patch) | |
tree | bbbb8e4579f523e72e94d0525d55cfdb394b1544 | |
parent | 03623b4b041cde396641399c343f52ce840d349d (diff) |
rtc: pcf2127: bugfix: watchdog build dependency
Disable watchdog registation when kernel is build without
watchdog functionality, and enable watchdog core otherwise.
This removes compile errors like the one below:
drivers/rtc/rtc-pcf2127.o: in function `pcf2127_probe.constprop.3':
rtc-pcf2127.c:(.text.unlikely+0x2c8): undefined reference to
`devm_watchdog_register_device'
Watchdog feature in chip will always be configured as
this is safe to do in both cases and minimize code churn.
Reported-by: Hulk Robot <hulkci@huawei.com>
Reported-by: YueHaibing <yuehaibing@huawei.com>
Fixes: bbc597561ce1 ("rtc: pcf2127: add watchdog feature support")
Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Link: https://lore.kernel.org/r/20190827143656.4734-1-bruno.thomsen@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | drivers/rtc/Kconfig | 1 | ||||
-rw-r--r-- | drivers/rtc/rtc-pcf2127.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 758f7a417470..da0aceb45095 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
@@ -886,6 +886,7 @@ config RTC_DRV_DS3232_HWMON | |||
886 | config RTC_DRV_PCF2127 | 886 | config RTC_DRV_PCF2127 |
887 | tristate "NXP PCF2127" | 887 | tristate "NXP PCF2127" |
888 | depends on RTC_I2C_AND_SPI | 888 | depends on RTC_I2C_AND_SPI |
889 | select WATCHDOG_CORE if WATCHDOG | ||
889 | help | 890 | help |
890 | If you say yes here you get support for the NXP PCF2127/29 RTC | 891 | If you say yes here you get support for the NXP PCF2127/29 RTC |
891 | chips with integrated quartz crystal for industrial applications. | 892 | chips with integrated quartz crystal for industrial applications. |
diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c index 3ec87d320766..02b069caffd5 100644 --- a/drivers/rtc/rtc-pcf2127.c +++ b/drivers/rtc/rtc-pcf2127.c | |||
@@ -475,9 +475,11 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap, | |||
475 | return ret; | 475 | return ret; |
476 | } | 476 | } |
477 | 477 | ||
478 | #ifdef CONFIG_WATCHDOG | ||
478 | ret = devm_watchdog_register_device(dev, &pcf2127->wdd); | 479 | ret = devm_watchdog_register_device(dev, &pcf2127->wdd); |
479 | if (ret) | 480 | if (ret) |
480 | return ret; | 481 | return ret; |
482 | #endif /* CONFIG_WATCHDOG */ | ||
481 | 483 | ||
482 | /* | 484 | /* |
483 | * Disable battery low/switch-over timestamp and interrupts. | 485 | * Disable battery low/switch-over timestamp and interrupts. |