watchdog: improve seting watchdog timeout and frequency
authorHans Dedecker <dedeckeh@gmail.com>
Sun, 4 Nov 2018 10:14:31 +0000 (11:14 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Thu, 8 Nov 2018 10:21:18 +0000 (11:21 +0100)
commit20192e47619861285fe66f1c72c8f1c2583fc0e6
tree41ba60c227cf93f2bdc17728acb2eefe1205a957
parent94944ab099a071a82eb830a6ded4426319dc2c78
watchdog: improve seting watchdog timeout and frequency

Due to the watchdog file descriptor check in both watchdog_timeout and
watchdog_frequency it's impossible to set the timeout/frequency via ubus
in case the watchdog was stopped.
Fix this by removing the watchdog file descriptor check in both functions
and by caching locally the set watchdog driver timeout value. The latter
will be used to set the watchdog driver timeout value in case the
watchdog is active or when the watchdog is started.
In addition when parsing the watchdog ubus call check if timeout
attribute is set so the correct value is used when doing the frequency
sanity check.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
system.c
watchdog.c