Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: ds1374: wdt: Fix stop/start ioctl always returning -EINVAL

The WDIOC_SETOPTIONS case in the watchdog ioctl would alwayss falls
through to the -EINVAL case. This is wrong since thew watchdog does
actually get stopped or started correctly.

Fixes: 920f91e50c5b ("drivers/rtc/rtc-ds1374.c: add watchdog support")
Signed-off-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

authored by

Moritz Fischer and committed by
Alexandre Belloni
538c08f4 453d0744

+2 -1
+2 -1
drivers/rtc/rtc-ds1374.c
··· 546 546 if (options & WDIOS_DISABLECARD) { 547 547 pr_info("disable watchdog\n"); 548 548 ds1374_wdt_disable(); 549 + return 0; 549 550 } 550 551 551 552 if (options & WDIOS_ENABLECARD) { 552 553 pr_info("enable watchdog\n"); 553 554 ds1374_wdt_settimeout(wdt_margin); 554 555 ds1374_wdt_ping(); 556 + return 0; 555 557 } 556 - 557 558 return -EINVAL; 558 559 } 559 560 return -ENOTTY;