diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2017-07-19 10:27:53 +0200 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2017-09-09 20:23:14 +0200 |
commit | 1c1b2434017206b612764fad1820b6dd48cb9e92 (patch) | |
tree | 1d47103d9aa3c0b6ad81e5a09d5554a5eb2cf810 /drivers/watchdog/renesas_wdt.c | |
parent | b51247c8029660a9c49ad48bf38f364479c96215 (diff) | |
download | op-kernel-dev-1c1b2434017206b612764fad1820b6dd48cb9e92.zip op-kernel-dev-1c1b2434017206b612764fad1820b6dd48cb9e92.tar.gz |
watchdog: renesas_wdt: don't round closest with get_timeleft
We should never return more time left than there actually is. So, switch
to a plain divider instead of DIV_ROUND_CLOSEST.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/renesas_wdt.c')
-rw-r--r-- | drivers/watchdog/renesas_wdt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c index 8437dd5..3763437 100644 --- a/drivers/watchdog/renesas_wdt.c +++ b/drivers/watchdog/renesas_wdt.c @@ -92,7 +92,7 @@ static unsigned int rwdt_get_timeleft(struct watchdog_device *wdev) struct rwdt_priv *priv = watchdog_get_drvdata(wdev); u16 val = readw_relaxed(priv->base + RWTCNT); - return DIV_ROUND_CLOSEST(65536 - val, priv->clks_per_sec); + return (65536 - val) / priv->clks_per_sec; } static const struct watchdog_info rwdt_ident = { |