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 <mad_soft@inbox.ru>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
Dmitry Artamonow 2012-01-26 23:24:30 +04:00 коммит произвёл Wim Van Sebroeck
Родитель f599aaf00f
Коммит 741b9c7da1
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -198,9 +198,13 @@ static long booke_wdt_ioctl(struct file *file,
booke_wdt_period = tmp; booke_wdt_period = tmp;
#endif #endif
booke_wdt_set(); booke_wdt_set();
return 0; /* Fall */
case WDIOC_GETTIMEOUT: 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); return put_user(booke_wdt_period, p);
#endif
default: default:
return -ENOTTY; return -ENOTTY;
} }