watchdog: orion_wdt: Mark watchdog as active when running at probe
authorMaxim Kochetkov <fido_max@inbox.ru>
Thu, 7 Jun 2018 13:54:37 +0000 (16:54 +0300)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Thu, 2 Aug 2018 13:57:09 +0000 (15:57 +0200)
If the watchdog is fully enabled and running at probe,
mark it as such so the watchdog core can handle it until
the watchdog device is opened.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
[groeck: Updated subject and description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/orion_wdt.c

index ea676d2..9db3b09 100644 (file)
@@ -581,6 +581,8 @@ static int orion_wdt_probe(struct platform_device *pdev)
         */
        if (!orion_wdt_enabled(&dev->wdt))
                orion_wdt_stop(&dev->wdt);
+       else
+               set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
 
        /* Request the IRQ only after the watchdog is disabled */
        irq = platform_get_irq(pdev, 0);