diff options
author | Viresh Kumar <viresh.kumar@st.com> | 2012-03-12 00:21:56 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-05-30 01:53:46 -0400 |
commit | 257f8c4aae392654d4ab846030b9f4518f16ed32 (patch) | |
tree | 54b97861301fa1097126f9d6d42633e835adff72 /drivers/watchdog | |
parent | 09a46e739780aab2eadf47afdefa70c9cd69d83d (diff) |
watchdog: Add watchdog_active() routine
Some watchdog may need to check if watchdog is ACTIVE or not, for example in
their suspend/resume hooks.
This patch adds this routine and changes the core drivers to use it.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/via_wdt.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/watchdog_dev.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c index 5603e31afdab..aa50da3ccfe3 100644 --- a/drivers/watchdog/via_wdt.c +++ b/drivers/watchdog/via_wdt.c | |||
@@ -91,7 +91,7 @@ static inline void wdt_reset(void) | |||
91 | static void wdt_timer_tick(unsigned long data) | 91 | static void wdt_timer_tick(unsigned long data) |
92 | { | 92 | { |
93 | if (time_before(jiffies, next_heartbeat) || | 93 | if (time_before(jiffies, next_heartbeat) || |
94 | (!test_bit(WDOG_ACTIVE, &wdt_dev.status))) { | 94 | (!watchdog_active(&wdt_dev))) { |
95 | wdt_reset(); | 95 | wdt_reset(); |
96 | mod_timer(&timer, jiffies + WDT_HEARTBEAT); | 96 | mod_timer(&timer, jiffies + WDT_HEARTBEAT); |
97 | } else | 97 | } else |
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 6c18a58cfd17..930cc7c87457 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c | |||
@@ -61,7 +61,7 @@ static struct watchdog_device *wdd; | |||
61 | 61 | ||
62 | static int watchdog_ping(struct watchdog_device *wddev) | 62 | static int watchdog_ping(struct watchdog_device *wddev) |
63 | { | 63 | { |
64 | if (test_bit(WDOG_ACTIVE, &wddev->status)) { | 64 | if (watchdog_active(wddev)) { |
65 | if (wddev->ops->ping) | 65 | if (wddev->ops->ping) |
66 | return wddev->ops->ping(wddev); /* ping the watchdog */ | 66 | return wddev->ops->ping(wddev); /* ping the watchdog */ |
67 | else | 67 | else |
@@ -83,7 +83,7 @@ static int watchdog_start(struct watchdog_device *wddev) | |||
83 | { | 83 | { |
84 | int err; | 84 | int err; |
85 | 85 | ||
86 | if (!test_bit(WDOG_ACTIVE, &wddev->status)) { | 86 | if (!watchdog_active(wddev)) { |
87 | err = wddev->ops->start(wddev); | 87 | err = wddev->ops->start(wddev); |
88 | if (err < 0) | 88 | if (err < 0) |
89 | return err; | 89 | return err; |
@@ -113,7 +113,7 @@ static int watchdog_stop(struct watchdog_device *wddev) | |||
113 | return err; | 113 | return err; |
114 | } | 114 | } |
115 | 115 | ||
116 | if (test_bit(WDOG_ACTIVE, &wddev->status)) { | 116 | if (watchdog_active(wddev)) { |
117 | err = wddev->ops->stop(wddev); | 117 | err = wddev->ops->stop(wddev); |
118 | if (err < 0) | 118 | if (err < 0) |
119 | return err; | 119 | return err; |