From efec95a6eeb501b08f2265ffc7237572fba32fa6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 14 Jan 2024 11:50:57 +0000 Subject: [PATCH] Revert "device property: Allow const parameter to dev_fwnode()" This reverts commit 29cb16577189b1db9b39d4efce5e37a7c4acc183 which is commit b295d484b97081feba72b071ffcb72fb4638ccfd upstream. It makes dev_fwnode() an inline function, when the Android abi seems to want it around because so many external modules rely on it. So revert this change for now. If it's needed in the future, it can come back in an abi-safe way. Bug: 161946584 Change-Id: I498bedf1e6e30477b25efa9577dcaf79e091b3e9 Signed-off-by: Greg Kroah-Hartman --- drivers/base/property.c | 11 ++--------- include/linux/property.h | 7 +------ 2 files changed, 3 insertions(+), 15 deletions(-) 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,