watchdog: f71808e_wdt: do stricter parameter validation
authorAhmad Fatoum <a.fatoum@pengutronix.de>
Thu, 11 Jun 2020 19:17:46 +0000 (21:17 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Wed, 5 Aug 2020 16:42:53 +0000 (18:42 +0200)
commit5edc8c687357b40469d90e3dab0b59b72eaabf59
tree972ff9be0adb3ece1e79d70ed752339057bc28d6
parent4f39d575844148fbf3081571a1f3b4ae04150958
watchdog: f71808e_wdt: do stricter parameter validation

We check the f71862fg_pin module parameter every time a watchdog device
for the f71862fg is opened, but the parameter can't change at runtime.

If we move the check to the start of init:

  - We catch userspace passing invalid, but unused, values
  - We check the condition only once
  - We simplify the code

Do so.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200611191750.28096-6-a.fatoum@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/f71808e_wdt.c