diff --git a/drivers/base/property.c b/drivers/base/property.c index eb9b01c2ff1d..b0c40d973484 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -17,19 +17,12 @@ #include #include -struct fwnode_handle *__dev_fwnode(struct device *dev) +struct fwnode_handle *dev_fwnode(const struct device *dev) { return IS_ENABLED(CONFIG_OF) && dev->of_node ? of_fwnode_handle(dev->of_node) : dev->fwnode; } -EXPORT_SYMBOL_GPL(__dev_fwnode); - -const struct fwnode_handle *__dev_fwnode_const(const struct device *dev) -{ - return IS_ENABLED(CONFIG_OF) && dev->of_node ? - of_fwnode_handle(dev->of_node) : dev->fwnode; -} -EXPORT_SYMBOL_GPL(__dev_fwnode_const); +EXPORT_SYMBOL_GPL(dev_fwnode); /** * device_property_present - check if a property of a device is present diff --git a/include/linux/property.h b/include/linux/property.h index 587b5b666b5b..117cc200c656 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -32,12 +32,7 @@ enum dev_dma_attr { DEV_DMA_COHERENT, }; -const struct fwnode_handle *__dev_fwnode_const(const struct device *dev); -struct fwnode_handle *__dev_fwnode(struct device *dev); -#define dev_fwnode(dev) \ - _Generic((dev), \ - const struct device *: __dev_fwnode_const, \ - struct device *: __dev_fwnode)(dev) +struct fwnode_handle *dev_fwnode(const 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,