Thread (1 message) 1 message, 1 author, 2012-11-19
DORMANTno replies

[PATCH v5 1/8] dt: add helper inline for retrieving timeout-sec property

From: Fabio Porcedda <hidden>
Date: 2012-11-19 14:10:36
Also in: linux-arm-kernel, linux-watchdog
Subsystem: open firmware and flattened device tree, the rest · Maintainers: Rob Herring, Saravana Kannan, Linus Torvalds

Possibly related (same subject, not in this thread)

The first user of this function is the watchdog framework.

Signed-off-by: Fabio Porcedda <redacted>
Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
---
 include/linux/of.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/include/linux/of.h b/include/linux/of.h
index b4e50d5..d60fde9 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -477,4 +477,15 @@ static inline int of_property_read_u32(const struct device_node *np,
 	return of_property_read_u32_array(np, propname, out_value, 1);
 }
 
+/**
+ * of_get_timeout_sec() - Helper to read the timeout_sec property
+ * @np:		device node from which the property value is to be read.
+ * @timeout:	adress of the output value
+ */
+static inline int of_get_timeout_sec(const struct device_node *np,
+				     u32 *timeout)
+{
+	return of_property_read_u32(np, "timeout-sec", timeout);
+}
+
 #endif /* _LINUX_OF_H */
-- 
1.8.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help