From: Wolfram Sang Date: Mon, 17 Jul 2017 17:12:24 +0000 (+0200) Subject: watchdog: asm9260_wdt: don't round closest with get_timeleft X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d94fa4655ed79784388cb49c17c5e9967ddfb4b9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git watchdog: asm9260_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 Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/asm9260_wdt.c b/drivers/watchdog/asm9260_wdt.c index 186fac4cccf5..7dd0da644a7f 100644 --- a/drivers/watchdog/asm9260_wdt.c +++ b/drivers/watchdog/asm9260_wdt.c @@ -82,7 +82,7 @@ static unsigned int asm9260_wdt_gettimeleft(struct watchdog_device *wdd) counter = ioread32(priv->iobase + HW_WDTV); - return DIV_ROUND_CLOSEST(counter, priv->wdt_freq); + return counter / priv->wdt_freq; } static int asm9260_wdt_updatetimeout(struct watchdog_device *wdd)