Thread (14 messages) 14 messages, 2 authors, 2017-02-24
STALE3424d
Revisions (3)
  1. v2 [diff vs current]
  2. v3 current
  3. v5 [diff vs current]

[PATCH v3 12/16] device property: Move dev_fwnode() to linux/property.h

From: Sakari Ailus <sakari.ailus@linux.intel.com>
Date: 2017-02-23 16:19:32
Also in: linux-acpi
Subsystem: driver core, kobjects, debugfs and sysfs, software nodes and device properties, the rest · Maintainers: Greg Kroah-Hartman, "Rafael J. Wysocki", Danilo Krummrich, Linus Torvalds

The function to obtain a fwnode related to a struct device is useful for
drivers that use the fwnode property API: it allows not being aware of the
underlying firmware implementation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/base/property.c  |  6 ------
 include/linux/property.h | 10 ++++++++--
 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 760c6c5..cf8bc2f 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -183,12 +183,6 @@ static int pset_prop_read_string(struct property_set *pset,
 	return 0;
 }
 
-static inline struct fwnode_handle *dev_fwnode(struct device *dev)
-{
-	return IS_ENABLED(CONFIG_OF) && dev->of_node ?
-		&dev->of_node->fwnode : dev->fwnode;
-}
-
 /**
  * device_property_present - check if a property of a device is present
  * @dev: Device whose property is being checked
diff --git a/include/linux/property.h b/include/linux/property.h
index b4b1545..09a75b1 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -13,11 +13,11 @@
 #ifndef _LINUX_PROPERTY_H_
 #define _LINUX_PROPERTY_H_
 
+#include <linux/device.h>
 #include <linux/fwnode.h>
+#include <linux/of.h>
 #include <linux/types.h>
 
-struct device;
-
 enum dev_prop_type {
 	DEV_PROP_U8,
 	DEV_PROP_U16,
@@ -33,6 +33,12 @@ enum dev_dma_attr {
 	DEV_DMA_COHERENT,
 };
 
+static inline struct fwnode_handle *dev_fwnode(struct device *dev)
+{
+	return IS_ENABLED(CONFIG_OF) && dev->of_node ?
+		&dev->of_node->fwnode : dev->fwnode;
+}
+
 bool device_property_present(struct device *dev, const char *propname);
 int device_property_read_u8_array(struct device *dev, const char *propname,
 				  u8 *val, size_t nval);
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help