diff options
| author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2011-08-03 18:38:20 -0400 |
|---|---|---|
| committer | Wim Van Sebroeck <wim@iguana.be> | 2011-09-20 08:22:28 -0400 |
| commit | cb7efc02c6dbc3bfe9d5d1509ed790fc757e05a9 (patch) | |
| tree | afee2bd68d6f4a20406fcb00cf994d98a6f210c1 | |
| parent | 9d037a777695993ec7437e5f451647dea7919d4c (diff) | |
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>
| -rw-r--r-- | drivers/watchdog/watchdog_dev.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index d33520d0b4c9..1199da0f98cf 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c | |||
| @@ -59,7 +59,7 @@ static struct watchdog_device *wdd; | |||
| 59 | 59 | ||
| 60 | static int watchdog_ping(struct watchdog_device *wddev) | 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 | if (wddev->ops->ping) | 63 | if (wddev->ops->ping) |
| 64 | return wddev->ops->ping(wddev); /* ping the watchdog */ | 64 | return wddev->ops->ping(wddev); /* ping the watchdog */ |
| 65 | else | 65 | else |
| @@ -81,12 +81,12 @@ static int watchdog_start(struct watchdog_device *wddev) | |||
| 81 | { | 81 | { |
| 82 | int err; | 82 | int err; |
| 83 | 83 | ||
| 84 | if (!test_bit(WDOG_ACTIVE, &wdd->status)) { | 84 | if (!test_bit(WDOG_ACTIVE, &wddev->status)) { |
| 85 | err = wddev->ops->start(wddev); | 85 | err = wddev->ops->start(wddev); |
| 86 | if (err < 0) | 86 | if (err < 0) |
| 87 | return err; | 87 | return err; |
| 88 | 88 | ||
| 89 | set_bit(WDOG_ACTIVE, &wdd->status); | 89 | set_bit(WDOG_ACTIVE, &wddev->status); |
| 90 | } | 90 | } |
| 91 | return 0; | 91 | return 0; |
| 92 | } | 92 | } |
| @@ -105,18 +105,18 @@ static int watchdog_stop(struct watchdog_device *wddev) | |||
| 105 | { | 105 | { |
| 106 | int err = -EBUSY; | 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 | pr_info("%s: nowayout prevents watchdog to be stopped!\n", | 109 | pr_info("%s: nowayout prevents watchdog to be stopped!\n", |
| 110 | wdd->info->identity); | 110 | wddev->info->identity); |
| 111 | return err; | 111 | return err; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | if (test_bit(WDOG_ACTIVE, &wdd->status)) { | 114 | if (test_bit(WDOG_ACTIVE, &wddev->status)) { |
| 115 | err = wddev->ops->stop(wddev); | 115 | err = wddev->ops->stop(wddev); |
| 116 | if (err < 0) | 116 | if (err < 0) |
| 117 | return err; | 117 | return err; |
| 118 | 118 | ||
| 119 | clear_bit(WDOG_ACTIVE, &wdd->status); | 119 | clear_bit(WDOG_ACTIVE, &wddev->status); |
| 120 | } | 120 | } |
| 121 | return 0; | 121 | return 0; |
| 122 | } | 122 | } |
