mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
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>
This commit is contained in:
parent
b51247c802
commit
1c1b243401
1 changed files with 1 additions and 1 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue