From: Guenter Roeck Date: Tue, 11 Mar 2025 14:10:09 +0000 (-0700) Subject: watchdog: Convert to use device property X-Git-Tag: v6.15-rc1~73^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=594e1e368f09cea198f991ab122dd72ed559a383;p=thirdparty%2Flinux.git watchdog: Convert to use device property Use device_property_read_u32() instead of of_property_read_u32() to support reading the timeout from non-devicetree sources. Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20250311141009.756975-1-linux@roeck-us.net Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index d46d8c8c01f2d..6152dba4b52cb 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c @@ -33,7 +33,8 @@ #include /* For __init/__exit/... */ #include /* For ida_* macros */ #include /* For IS_ERR macros */ -#include /* For of_get_timeout_sec */ +#include /* For of_alias_get_id */ +#include /* For device_property_read_u32 */ #include #include "watchdog_core.h" /* For watchdog_dev_register/... */ @@ -137,8 +138,7 @@ int watchdog_init_timeout(struct watchdog_device *wdd, } /* try to get the timeout_sec property */ - if (dev && dev->of_node && - of_property_read_u32(dev->of_node, "timeout-sec", &t) == 0) { + if (dev && device_property_read_u32(dev, "timeout-sec", &t) == 0) { if (t && !watchdog_timeout_invalid(wdd, t)) { wdd->timeout = t; return 0;