Skip to content

Commit 938626d

Browse files
vireshkWim Van Sebroeck
authored andcommitted
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 <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]> Cc: <[email protected]> # 2.6.36+
1 parent d2deeba commit 938626d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/watchdog/sp805_wdt.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
* @adev: amba device structure of wdt
6060
* @status: current status of wdt
6161
* @load_val: load value to be set for current timeout
62-
* @timeout: current programmed timeout
6362
*/
6463
struct sp805_wdt {
6564
struct watchdog_device wdd;
@@ -68,7 +67,6 @@ struct sp805_wdt {
6867
struct clk *clk;
6968
struct amba_device *adev;
7069
unsigned int load_val;
71-
unsigned int timeout;
7270
};
7371

7472
static bool nowayout = WATCHDOG_NOWAYOUT;
@@ -98,7 +96,7 @@ static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout)
9896
spin_lock(&wdt->lock);
9997
wdt->load_val = load;
10098
/* 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);
102100
spin_unlock(&wdt->lock);
103101

104102
return 0;

0 commit comments

Comments
 (0)