diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2012-02-29 14:20:58 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 14:08:09 -0400 |
commit | 0197c1c49ef1ff386b2ebb6d3b0fc85a8e174b5c (patch) | |
tree | 266ad74d44c332e27eac61070f7287051035136f /drivers/watchdog | |
parent | b10f7c12e051762b84457f6d38d4b71acbf76a02 (diff) |
watchdog: fix set_timeout operations
Since we changed the behaviour of the set_timeout operation in the
watchdog API, we need to change the allready converted drivers so
that they update the timeout field at the end of the set_timeout
operation.
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/jz4740_wdt.c | 1 | ||||
-rw-r--r-- | drivers/watchdog/pnx4008_wdt.c | 1 | ||||
-rw-r--r-- | drivers/watchdog/s3c2410_wdt.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/via_wdt.c | 6 | ||||
-rw-r--r-- | drivers/watchdog/wm831x_wdt.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/wm8350_wdt.c | 1 |
6 files changed, 10 insertions, 3 deletions
diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c index 28af416c3fbf..978615ef899d 100644 --- a/drivers/watchdog/jz4740_wdt.c +++ b/drivers/watchdog/jz4740_wdt.c | |||
@@ -109,6 +109,7 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev, | |||
109 | 109 | ||
110 | writeb(0x1, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE); | 110 | writeb(0x1, drvdata->base + JZ_REG_WDT_COUNTER_ENABLE); |
111 | 111 | ||
112 | wdt_dev->timeout = new_timeout; | ||
112 | return 0; | 113 | return 0; |
113 | } | 114 | } |
114 | 115 | ||
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index 3d9bb89776a7..6b8432f61d05 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c | |||
@@ -121,6 +121,7 @@ static int pnx4008_wdt_stop(struct watchdog_device *wdd) | |||
121 | static int pnx4008_wdt_set_timeout(struct watchdog_device *wdd, | 121 | static int pnx4008_wdt_set_timeout(struct watchdog_device *wdd, |
122 | unsigned int new_timeout) | 122 | unsigned int new_timeout) |
123 | { | 123 | { |
124 | wdd->timeout = new_timeout; | ||
124 | return 0; | 125 | return 0; |
125 | } | 126 | } |
126 | 127 | ||
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 96b598c52dac..46c251d1893d 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c | |||
@@ -201,6 +201,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou | |||
201 | writel(count, wdt_base + S3C2410_WTDAT); | 201 | writel(count, wdt_base + S3C2410_WTDAT); |
202 | writel(wtcon, wdt_base + S3C2410_WTCON); | 202 | writel(wtcon, wdt_base + S3C2410_WTCON); |
203 | 203 | ||
204 | wdd->timeout = timeout; | ||
205 | |||
204 | return 0; | 206 | return 0; |
205 | } | 207 | } |
206 | 208 | ||
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c index ef83f0242411..465e08273c97 100644 --- a/drivers/watchdog/via_wdt.c +++ b/drivers/watchdog/via_wdt.c | |||
@@ -101,7 +101,7 @@ static void wdt_timer_tick(unsigned long data) | |||
101 | static int wdt_ping(struct watchdog_device *wdd) | 101 | static int wdt_ping(struct watchdog_device *wdd) |
102 | { | 102 | { |
103 | /* calculate when the next userspace timeout will be */ | 103 | /* calculate when the next userspace timeout will be */ |
104 | next_heartbeat = jiffies + timeout * HZ; | 104 | next_heartbeat = jiffies + wdd->timeout * HZ; |
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
@@ -109,7 +109,7 @@ static int wdt_start(struct watchdog_device *wdd) | |||
109 | { | 109 | { |
110 | unsigned int ctl = readl(wdt_mem); | 110 | unsigned int ctl = readl(wdt_mem); |
111 | 111 | ||
112 | writel(timeout, wdt_mem + VIA_WDT_COUNT); | 112 | writel(wdd->timeout, wdt_mem + VIA_WDT_COUNT); |
113 | writel(ctl | VIA_WDT_RUNNING | VIA_WDT_TRIGGER, wdt_mem); | 113 | writel(ctl | VIA_WDT_RUNNING | VIA_WDT_TRIGGER, wdt_mem); |
114 | wdt_ping(wdd); | 114 | wdt_ping(wdd); |
115 | mod_timer(&timer, jiffies + WDT_HEARTBEAT); | 115 | mod_timer(&timer, jiffies + WDT_HEARTBEAT); |
@@ -128,7 +128,7 @@ static int wdt_set_timeout(struct watchdog_device *wdd, | |||
128 | unsigned int new_timeout) | 128 | unsigned int new_timeout) |
129 | { | 129 | { |
130 | writel(new_timeout, wdt_mem + VIA_WDT_COUNT); | 130 | writel(new_timeout, wdt_mem + VIA_WDT_COUNT); |
131 | timeout = new_timeout; | 131 | wdd->timeout = new_timeout; |
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
134 | 134 | ||
diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c index b3e8a62f27a9..b1815c5ed7a7 100644 --- a/drivers/watchdog/wm831x_wdt.c +++ b/drivers/watchdog/wm831x_wdt.c | |||
@@ -163,6 +163,8 @@ static int wm831x_wdt_set_timeout(struct watchdog_device *wdt_dev, | |||
163 | ret); | 163 | ret); |
164 | } | 164 | } |
165 | 165 | ||
166 | wdt_dev->timeout = timeout; | ||
167 | |||
166 | return ret; | 168 | return ret; |
167 | } | 169 | } |
168 | 170 | ||
diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c index 0ce572c15659..3c76693447fd 100644 --- a/drivers/watchdog/wm8350_wdt.c +++ b/drivers/watchdog/wm8350_wdt.c | |||
@@ -60,6 +60,7 @@ static int wm8350_wdt_set_timeout(struct watchdog_device *wdt_dev, | |||
60 | wm8350_reg_lock(wm8350); | 60 | wm8350_reg_lock(wm8350); |
61 | mutex_unlock(&wdt_mutex); | 61 | mutex_unlock(&wdt_mutex); |
62 | 62 | ||
63 | wdt_dev->timeout = timeout; | ||
63 | return ret; | 64 | return ret; |
64 | } | 65 | } |
65 | 66 | ||