Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250311141009.756975-1-linux@roeck-us.net
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Guenter Roeck and committed by
Wim Van Sebroeck
594e1e36 0ccd5d56

+3 -3
+3 -3
drivers/watchdog/watchdog_core.c
··· 33 33 #include <linux/init.h> /* For __init/__exit/... */ 34 34 #include <linux/idr.h> /* For ida_* macros */ 35 35 #include <linux/err.h> /* For IS_ERR macros */ 36 - #include <linux/of.h> /* For of_get_timeout_sec */ 36 + #include <linux/of.h> /* For of_alias_get_id */ 37 + #include <linux/property.h> /* For device_property_read_u32 */ 37 38 #include <linux/suspend.h> 38 39 39 40 #include "watchdog_core.h" /* For watchdog_dev_register/... */ ··· 138 137 } 139 138 140 139 /* try to get the timeout_sec property */ 141 - if (dev && dev->of_node && 142 - of_property_read_u32(dev->of_node, "timeout-sec", &t) == 0) { 140 + if (dev && device_property_read_u32(dev, "timeout-sec", &t) == 0) { 143 141 if (t && !watchdog_timeout_invalid(wdd, t)) { 144 142 wdd->timeout = t; 145 143 return 0;