device property: Make dev_fwnode() public
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 28 Mar 2017 07:52:24 +0000 (10:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2017 15:49:29 +0000 (08:49 -0700)
commit e44bb0cbdc88686c21e2175a990b40bf6db5d005 upstream.

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>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/property.c
include/linux/property.h

index 43a36d68c3fded1602c9e8ce97358264c9f33c8a..06f66687fe0b76fff14fa307c30d1eaec674b88d 100644 (file)
@@ -182,11 +182,12 @@ static int pset_prop_read_string(struct property_set *pset,
        return 0;
 }
 
-static inline struct fwnode_handle *dev_fwnode(struct device *dev)
+struct fwnode_handle *dev_fwnode(struct device *dev)
 {
        return IS_ENABLED(CONFIG_OF) && dev->of_node ?
                &dev->of_node->fwnode : dev->fwnode;
 }
+EXPORT_SYMBOL_GPL(dev_fwnode);
 
 /**
  * device_property_present - check if a property of a device is present
index 856e50b2140ce76971b481a9d61777e10c5ea4d0..338f9b76914bb545d735c1f87ecbc298009e6a8b 100644 (file)
@@ -33,6 +33,8 @@ enum dev_dma_attr {
        DEV_DMA_COHERENT,
 };
 
+struct fwnode_handle *dev_fwnode(struct device *dev);
+
 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);