linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] of: introduce helper to manage boolean
@ 2012-03-13 17:03 Jean-Christophe PLAGNIOL-VILLARD
  2012-03-13 17:21 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-03-13 17:03 UTC (permalink / raw)
  To: linux-arm-kernel

of_property_read_bool

Search for a property in a device node.
Returns true if the property exist false otherwise.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
v3:

	include Grant comment

	Grant can I get the go please?

Best Regards,
J.
 include/linux/of.h |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index a75a831..a992cdf 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -342,6 +342,22 @@ static inline int of_machine_is_compatible(const char *compat)
 #define of_match_node(_matches, _node)	NULL
 #endif /* CONFIG_OF */
 
+/**
+ * of_property_read_bool - Findfrom a property
+ * @np:		device node from which the property value is to be read.
+ * @propname:	name of the property to be searched.
+ *
+ * Search for a property in a device node.
+ * Returns true if the property exist false otherwise.
+ */
+static inline bool of_property_read_bool(const struct device_node *np,
+					 const char *propname)
+{
+	struct property *prop = of_find_property(np, propname, NULL);
+
+	return prop ? false : true;
+}
+
 static inline int of_property_read_u32(const struct device_node *np,
 				       const char *propname,
 				       u32 *out_value)
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v3] of: introduce helper to manage boolean
  2012-03-13 17:03 [PATCH v3] of: introduce helper to manage boolean Jean-Christophe PLAGNIOL-VILLARD
@ 2012-03-13 17:21 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2012-03-13 17:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 13 March 2012, Jean-Christophe PLAGNIOL-VILLARD wrote:
> of_property_read_bool
> 
> Search for a property in a device node.
> Returns true if the property exist false otherwise.
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Acked-by: Rob Herring <rob.herring@calxeda.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-13 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13 17:03 [PATCH v3] of: introduce helper to manage boolean Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 17:21 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).