]> asedeno.scripts.mit.edu Git - linux.git/commit
watchdog: refactor watchdog_init_timeout
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 19 Apr 2019 18:15:46 +0000 (20:15 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 5 May 2019 19:04:58 +0000 (21:04 +0200)
commit34ef4087a1d50f5481732ad85544362516e8185f
tree3d36d748bdfa21c2ed450a7c5fea3b57afdea562
parente18431264954247f76a8e7aeac3b68421e35e65a
watchdog: refactor watchdog_init_timeout

The function is not easy to read and has a problem: -EINVAL is returned
when the module parameter is invalid but the DT parameter is OK.

Refactor the code to have the same pattern of checks for the module
parameter and DT. Further ones can be easily added in the future if the
need arises. The above mentioned problem is fixed, too.

Some documentation is added to describe the different handlings of '0'
for the module parameter and the DT property.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/watchdog_core.c