Skip to content

Commit

Permalink
rtc: pcf2127: only use watchdog when explicitly available
Browse files Browse the repository at this point in the history
commit 71ac134 upstream.

Most boards using the pcf2127 chip (in my bubble) don't make use of the
watchdog functionality and the respective output is not connected. The
effect on such a board is that there is a watchdog device provided that
doesn't work.

So only register the watchdog if the device tree has a "reset-source"
property.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[RV: s/has-watchdog/reset-source/]
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201218101054.25416-3-rasmus.villemoes@prevas.dk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Uwe Kleine-König authored and gregkh committed Jan 9, 2021
1 parent acb8214 commit 757cd94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rtc/rtc-pcf2127.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ static int pcf2127_watchdog_init(struct device *dev, struct pcf2127 *pcf2127)
u32 wdd_timeout;
int ret;

if (!IS_ENABLED(CONFIG_WATCHDOG))
if (!IS_ENABLED(CONFIG_WATCHDOG) ||
!device_property_read_bool(dev, "reset-source"))
return 0;

pcf2127->wdd.parent = dev;
Expand Down

0 comments on commit 757cd94

Please sign in to comment.