diff mbox series

watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt

Message ID 20190410124813.86892-1-bryantan@vmware.com (mailing list archive)
State Accepted
Headers show
Series watchdog: wdat_wdt: fix get_timeleft call for wdat_wdt | expand

Commit Message

Bryan Tan April 10, 2019, 12:49 p.m. UTC
The get_timeleft call for wdat_wdt was using ACPI_WDAT_GET_COUNTDOWN
when running an action on the device, which would return the configured
countdown, instead of ACPI_WDAT_GET_CURRENT_COUNTDOWN, which returns the
time left before the watchdog will fire. This change corrects that.

Signed-off-by: Bryan Tan <bryantan@vmware.com>
---
 drivers/watchdog/wdat_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck April 10, 2019, 1:38 p.m. UTC | #1
On 4/10/19 5:49 AM, Bryan Tan wrote:
> The get_timeleft call for wdat_wdt was using ACPI_WDAT_GET_COUNTDOWN
> when running an action on the device, which would return the configured
> countdown, instead of ACPI_WDAT_GET_CURRENT_COUNTDOWN, which returns the
> time left before the watchdog will fire. This change corrects that.
> 
> Signed-off-by: Bryan Tan <bryantan@vmware.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/wdat_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c
> index 56ad196..387892f 100644
> --- a/drivers/watchdog/wdat_wdt.c
> +++ b/drivers/watchdog/wdat_wdt.c
> @@ -287,7 +287,7 @@ static unsigned int wdat_wdt_get_timeleft(struct watchdog_device *wdd)
>   	struct wdat_wdt *wdat = to_wdat_wdt(wdd);
>   	u32 periods = 0;
>   
> -	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_COUNTDOWN, 0, &periods);
> +	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_CURRENT_COUNTDOWN, 0, &periods);
>   	return periods * wdat->period / 1000;
>   }
>   
>
diff mbox series

Patch

diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c
index 56ad196..387892f 100644
--- a/drivers/watchdog/wdat_wdt.c
+++ b/drivers/watchdog/wdat_wdt.c
@@ -287,7 +287,7 @@  static unsigned int wdat_wdt_get_timeleft(struct watchdog_device *wdd)
 	struct wdat_wdt *wdat = to_wdat_wdt(wdd);
 	u32 periods = 0;
 
-	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_COUNTDOWN, 0, &periods);
+	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_CURRENT_COUNTDOWN, 0, &periods);
 	return periods * wdat->period / 1000;
 }