Commit aa767cfb authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Rob Herring

of: provide inline helper for of_find_device_by_node

The ipmmu-vmsa driver fails in compile-testing on non-OF platforms:

drivers/iommu/ipmmu-vmsa.o: In function `ipmmu_of_xlate':
ipmmu-vmsa.c:(.text+0x740): undefined reference to `of_find_device_by_node'

It would be reasonable to assume that this interface works but
returns failure on non-OF builds, like it does on machines that
have been booted in another way, so this adds another inline
function helper.

Fixes: 7b2d5961 ("iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 2bd6bf03
...@@ -57,7 +57,14 @@ extern const struct of_device_id of_default_bus_match_table[]; ...@@ -57,7 +57,14 @@ extern const struct of_device_id of_default_bus_match_table[];
extern struct platform_device *of_device_alloc(struct device_node *np, extern struct platform_device *of_device_alloc(struct device_node *np,
const char *bus_id, const char *bus_id,
struct device *parent); struct device *parent);
#ifdef CONFIG_OF
extern struct platform_device *of_find_device_by_node(struct device_node *np); extern struct platform_device *of_find_device_by_node(struct device_node *np);
#else
static inline struct platform_device *of_find_device_by_node(struct device_node *np)
{
return NULL;
}
#endif
/* Platform devices and busses creation */ /* Platform devices and busses creation */
extern struct platform_device *of_platform_device_create(struct device_node *np, extern struct platform_device *of_platform_device_create(struct device_node *np,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment