Commit cb7efc02c6dbc3bfe9d5d1509ed790fc757e05a9
Committed by
Wim Van Sebroeck
1 parent
9d037a7776
Exists in
master
and in
6 other branches
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>
Showing 1 changed file with 7 additions and 7 deletions Side-by-side Diff
drivers/watchdog/watchdog_dev.c
... | ... | @@ -59,7 +59,7 @@ |
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 |
66 | 66 | |
... | ... | @@ -81,12 +81,12 @@ |
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 | } |
93 | 93 | |
94 | 94 | |
95 | 95 | |
... | ... | @@ -105,18 +105,18 @@ |
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 | } |