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 config RTC_DRV_PCF2127 tristate "NXP PCF2127" depends on RTC_I2C_AND_SPI + select WATCHDOG_CORE if WATCHDOG help If you say yes here you get support for the NXP PCF2127/29 RTC 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, return ret; } +#ifdef CONFIG_WATCHDOG ret = devm_watchdog_register_device(dev, &pcf2127->wdd); if (ret) return ret; +#endif /* CONFIG_WATCHDOG */ /* * Disable battery low/switch-over timestamp and interrupts.