From: Dmitry Artamonow Date: Thu, 26 Jan 2012 19:24:30 +0000 (+0400) Subject: watchdog: fix GETTIMEOUT ioctl in booke_wdt X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=741b9c7da1abf2f96f69d232fbeef5aff1371be3;p=linux-beck.git watchdog: fix GETTIMEOUT ioctl in booke_wdt Commit dcfb748422 ([WATCHDOG] fix book E watchdog to take WDIOC_SETTIMEOUT arg in seconds) fixed SETTIMEOUT ioctl to use seconds as a parameter instead of some hardware-specific "period", but missed to apply similar changes to GETTIMEOUT, so it still returns "period" value. Let's fix it! Also, while at it, make SETTIMEOUT ioctl return real timeout value as it should do according to the documentation. Signed-off-by: Dmitry Artamonow Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c index 337265b47305..7c0fdfca2646 100644 --- a/drivers/watchdog/booke_wdt.c +++ b/drivers/watchdog/booke_wdt.c @@ -198,9 +198,13 @@ static long booke_wdt_ioctl(struct file *file, booke_wdt_period = tmp; #endif booke_wdt_set(); - return 0; + /* Fall */ case WDIOC_GETTIMEOUT: +#ifdef CONFIG_FSL_BOOKE + return put_user(period_to_sec(booke_wdt_period), p); +#else return put_user(booke_wdt_period, p); +#endif default: return -ENOTTY; }