Skip to content

Commit 594e1e3

Browse files
groeckWim Van Sebroeck
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 0ccd5d5 commit 594e1e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/watchdog/watchdog_core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
#include <linux/init.h> /* For __init/__exit/... */
3434
#include <linux/idr.h> /* For ida_* macros */
3535
#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 */
3738
#include <linux/suspend.h>
3839

3940
#include "watchdog_core.h" /* For watchdog_dev_register/... */
@@ -137,8 +138,7 @@ int watchdog_init_timeout(struct watchdog_device *wdd,
137138
}
138139

139140
/* try to get the timeout_sec property */
140-
if (dev && dev->of_node &&
141-
of_property_read_u32(dev->of_node, "timeout-sec", &t) == 0) {
141+
if (dev && device_property_read_u32(dev, "timeout-sec", &t) == 0) {
142142
if (t && !watchdog_timeout_invalid(wdd, t)) {
143143
wdd->timeout = t;
144144
return 0;

0 commit comments

Comments
 (0)