diff options
author | Robin Gong <b38343@freescale.com> | 2015-11-02 18:09:43 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@nxp.com> | 2016-01-14 11:02:12 -0600 |
commit | 0b8bcbd3618bfb24f1552be7e251bef6a3eca411 (patch) | |
tree | 467a5dd0a526e3bead73d6e2c68aca17824af7c5 /drivers/watchdog | |
parent | ecc71ea8693e01372b4766b8a1cea1ce831f162a (diff) |
MLK-11809: watchdog: imx2_wdt: correct timeout after set_timeout()
Correct wdog->timeout after set_timeout(), otherwise, the WDIOC_GETTIMEOUT
will return the default value '60s' always, correct it and also for the new
wdog->pretimeout.
Signed-off-by: Robin Gong <b38343@freescale.com>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/imx2_wdt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index 5b9f9af4113e..805df6b33625 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c @@ -181,6 +181,9 @@ static int imx2_wdt_set_timeout(struct watchdog_device *wdog, regmap_update_bits(wdev->regmap, IMX2_WDT_WCR, IMX2_WDT_WCR_WT, WDOG_SEC_TO_COUNT(new_timeout)); + + wdog->timeout = new_timeout; + return 0; } @@ -241,6 +244,8 @@ static int imx2_wdt_set_pretimeout(struct watchdog_device *wdog, unsigned int ne regmap_write(wdev->regmap, IMX2_WDT_WICR, val); + wdog->pretimeout = new_timeout; + return 0; } |