Skip to content

Commit

Permalink
watchdog: fix GETTIMEOUT ioctl in booke_wdt
Browse files Browse the repository at this point in the history
Commit dcfb748 ([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 <mad_soft@inbox.ru>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
dja-dja-mad authored and Wim Van Sebroeck committed Feb 29, 2012
1 parent f599aaf commit 741b9c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/watchdog/booke_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 741b9c7

Please sign in to comment.