[PATCH 4.4 04/33] watchdog: f71808e_wdt: indicate WDIOF_CARDRESET support in watchdog_info.options

From: Greg Kroah-Hartman
Date: Mon Aug 24 2020 - 05:33:03 EST


From: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>

[ Upstream commit e871e93fb08a619dfc015974a05768ed6880fd82 ]

The driver supports populating bootstatus with WDIOF_CARDRESET, but so
far userspace couldn't portably determine whether absence of this flag
meant no watchdog reset or no driver support. Or-in the bit to fix this.

Fixes: b97cb21a4634 ("watchdog: f71808e_wdt: Fix WDTMOUT_STS register read")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20200611191750.28096-3-a.fatoum@xxxxxxxxxxxxxx
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
Signed-off-by: Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/watchdog/f71808e_wdt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c
index 2048aad91add8..3577e356e08cc 100644
--- a/drivers/watchdog/f71808e_wdt.c
+++ b/drivers/watchdog/f71808e_wdt.c
@@ -644,7 +644,8 @@ static int __init watchdog_init(int sioaddr)
watchdog.sioaddr = sioaddr;
watchdog.ident.options = WDIOC_SETTIMEOUT
| WDIOF_MAGICCLOSE
- | WDIOF_KEEPALIVEPING;
+ | WDIOF_KEEPALIVEPING
+ | WDIOF_CARDRESET;

snprintf(watchdog.ident.identity,
sizeof(watchdog.ident.identity), "%s watchdog",
--
2.25.1