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

watchdog: WatchDog Timer Driver Core - use passed watchdog_device

Use the passed watchdog_device instead of the static global variable when
testing and setting the status in watchdog_ping, watchdog_start, and
watchdog_stop. Note that the callers of these functions are actually
passing the static global variable.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

H Hartley Sweeten and committed by
Wim Van Sebroeck
cb7efc02 9d037a77

+7 -7
+7 -7
drivers/watchdog/watchdog_dev.c
··· 59 59 60 60 static int watchdog_ping(struct watchdog_device *wddev) 61 61 { 62 - if (test_bit(WDOG_ACTIVE, &wdd->status)) { 62 + if (test_bit(WDOG_ACTIVE, &wddev->status)) { 63 63 if (wddev->ops->ping) 64 64 return wddev->ops->ping(wddev); /* ping the watchdog */ 65 65 else ··· 81 81 { 82 82 int err; 83 83 84 - if (!test_bit(WDOG_ACTIVE, &wdd->status)) { 84 + if (!test_bit(WDOG_ACTIVE, &wddev->status)) { 85 85 err = wddev->ops->start(wddev); 86 86 if (err < 0) 87 87 return err; 88 88 89 - set_bit(WDOG_ACTIVE, &wdd->status); 89 + set_bit(WDOG_ACTIVE, &wddev->status); 90 90 } 91 91 return 0; 92 92 } ··· 105 105 { 106 106 int err = -EBUSY; 107 107 108 - if (test_bit(WDOG_NO_WAY_OUT, &wdd->status)) { 108 + if (test_bit(WDOG_NO_WAY_OUT, &wddev->status)) { 109 109 pr_info("%s: nowayout prevents watchdog to be stopped!\n", 110 - wdd->info->identity); 110 + wddev->info->identity); 111 111 return err; 112 112 } 113 113 114 - if (test_bit(WDOG_ACTIVE, &wdd->status)) { 114 + if (test_bit(WDOG_ACTIVE, &wddev->status)) { 115 115 err = wddev->ops->stop(wddev); 116 116 if (err < 0) 117 117 return err; 118 118 119 - clear_bit(WDOG_ACTIVE, &wdd->status); 119 + clear_bit(WDOG_ACTIVE, &wddev->status); 120 120 } 121 121 return 0; 122 122 }