aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-07-26 18:42:35 +0100
committerBen Hutchings <ben.hutchings@codethink.co.uk>2018-08-24 19:09:47 +0100
commit6d42b2a23f3b9ccde13e5cdb8c9e6db312efb7a9 (patch)
treee4cd6808de00ba7fa2a029d7e7e2990e71e19e89
parent1e77a4982b6f9fbbbd7f9d99eaa694f4757ddff3 (diff)
downloadlinux-cip-6d42b2a23f3b9ccde13e5cdb8c9e6db312efb7a9.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> (cherry picked from commit 1c1b2434017206b612764fad1820b6dd48cb9e92) Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> Reviewed-by: Biju Das <biju.das@bp.renesas.com> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
-rw-r--r--drivers/watchdog/renesas_wdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index 9d68eb0ab39bcf..64f68d12cb8f3c 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -98,7 +98,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 = {