Revert "device property: Allow const parameter to dev_fwnode()"

This reverts commit 339add0430 which is
commit b295d484b9 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 <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-01-11 10:36:30 +00:00
parent 19757b5e8d
commit 34a1ceac5a
2 changed files with 3 additions and 15 deletions

View File

@@ -18,19 +18,12 @@
#include <linux/etherdevice.h>
#include <linux/phy.h>
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

View File

@@ -31,12 +31,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,