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

This reverts commit 29cb165771 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 <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2024-01-14 11:50:57 +00:00
parent 8eac30b25e
commit efec95a6ee
2 changed files with 3 additions and 15 deletions

View File

@ -17,19 +17,12 @@
#include <linux/property.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

@ -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,