Skip to content

Commit aa767cf

Browse files
arndbrobherring
authored andcommitted
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: 7b2d596 ("iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent 2bd6bf0 commit aa767cf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/linux/of_platform.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ extern const struct of_device_id of_default_bus_match_table[];
5757
extern struct platform_device *of_device_alloc(struct device_node *np,
5858
const char *bus_id,
5959
struct device *parent);
60+
#ifdef CONFIG_OF
6061
extern struct platform_device *of_find_device_by_node(struct device_node *np);
62+
#else
63+
static inline struct platform_device *of_find_device_by_node(struct device_node *np)
64+
{
65+
return NULL;
66+
}
67+
#endif
6168

6269
/* Platform devices and busses creation */
6370
extern struct platform_device *of_platform_device_create(struct device_node *np,

0 commit comments

Comments
 (0)