Skip to content

Commit

Permalink
watchdog: sp805: Set watchdog_device->timeout from ->set_timeout()
Browse files Browse the repository at this point in the history
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+
  • Loading branch information
vireshk authored and Wim Van Sebroeck committed Jun 10, 2014
1 parent d2deeba commit 938626d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/watchdog/sp805_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
* @adev: amba device structure of wdt
* @status: current status of wdt
* @load_val: load value to be set for current timeout
* @timeout: current programmed timeout
*/
struct sp805_wdt {
struct watchdog_device wdd;
Expand All @@ -68,7 +67,6 @@ struct sp805_wdt {
struct clk *clk;
struct amba_device *adev;
unsigned int load_val;
unsigned int timeout;
};

static bool nowayout = WATCHDOG_NOWAYOUT;
Expand Down Expand Up @@ -98,7 +96,7 @@ static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout)
spin_lock(&wdt->lock);
wdt->load_val = load;
/* roundup timeout to closest positive integer value */
wdt->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate);
spin_unlock(&wdt->lock);

return 0;
Expand Down

0 comments on commit 938626d

Please sign in to comment.