aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-05-15 00:31:59 -0400
committerWim Van Sebroeck <wim@iguana.be>2014-06-10 15:47:47 -0400
commit938626d96a3ffb9eb54552bb0d3a4f2b30ffdeb0 (patch)
tree8c7c5f97556b925ea22cbf810be1cdffcc9173a7
parentd2deebabaeedccf7cee943c1f7f6fdb44afd4e3d (diff)
watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
Implementation of ->set_timeout() is supposed to set 'timeout' field of 'struct watchdog_device' passed to it. sp805 was rather setting this in a local variable. Fix it. Reported-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Cc: <stable@vger.kernel.org> # 2.6.36+
-rw-r--r--drivers/watchdog/sp805_wdt.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 47629d268e0a..c1b03f4235b9 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -59,7 +59,6 @@
59 * @adev: amba device structure of wdt 59 * @adev: amba device structure of wdt
60 * @status: current status of wdt 60 * @status: current status of wdt
61 * @load_val: load value to be set for current timeout 61 * @load_val: load value to be set for current timeout
62 * @timeout: current programmed timeout
63 */ 62 */
64struct sp805_wdt { 63struct sp805_wdt {
65 struct watchdog_device wdd; 64 struct watchdog_device wdd;
@@ -68,7 +67,6 @@ struct sp805_wdt {
68 struct clk *clk; 67 struct clk *clk;
69 struct amba_device *adev; 68 struct amba_device *adev;
70 unsigned int load_val; 69 unsigned int load_val;
71 unsigned int timeout;
72}; 70};
73 71
74static bool nowayout = WATCHDOG_NOWAYOUT; 72static bool nowayout = WATCHDOG_NOWAYOUT;
@@ -98,7 +96,7 @@ static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout)
98 spin_lock(&wdt->lock); 96 spin_lock(&wdt->lock);
99 wdt->load_val = load; 97 wdt->load_val = load;
100 /* roundup timeout to closest positive integer value */ 98 /* roundup timeout to closest positive integer value */
101 wdt->timeout = div_u64((load + 1) * 2 + (rate / 2), rate); 99 wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
102 spin_unlock(&wdt->lock); 100 spin_unlock(&wdt->lock);
103 101
104 return 0; 102 return 0;