Skip to content

Commit 620e8e8

Browse files
Matthias Kaehlckegregkh
authored andcommitted
of/platform: Add stubs for of_platform_device_create/destroy()
Code for platform_device_create() and of_platform_device_destroy() is only generated if CONFIG_OF_ADDRESS=y. Add stubs to avoid unresolved symbols when CONFIG_OF_ADDRESS is not set. Reviewed-by: Stephen Boyd <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Matthias Kaehlcke <[email protected]> Link: https://lore.kernel.org/r/20220630123445.v24.1.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1742b76 commit 620e8e8

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

include/linux/of_platform.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ static inline struct platform_device *of_find_device_by_node(struct device_node
6161
}
6262
#endif
6363

64+
extern int of_platform_bus_probe(struct device_node *root,
65+
const struct of_device_id *matches,
66+
struct device *parent);
67+
68+
#ifdef CONFIG_OF_ADDRESS
6469
/* Platform devices and busses creation */
6570
extern struct platform_device *of_platform_device_create(struct device_node *np,
6671
const char *bus_id,
6772
struct device *parent);
6873

6974
extern int of_platform_device_destroy(struct device *dev, void *data);
70-
extern int of_platform_bus_probe(struct device_node *root,
71-
const struct of_device_id *matches,
72-
struct device *parent);
73-
#ifdef CONFIG_OF_ADDRESS
75+
7476
extern int of_platform_populate(struct device_node *root,
7577
const struct of_device_id *matches,
7678
const struct of_dev_auxdata *lookup,
@@ -84,6 +86,18 @@ extern int devm_of_platform_populate(struct device *dev);
8486

8587
extern void devm_of_platform_depopulate(struct device *dev);
8688
#else
89+
/* Platform devices and busses creation */
90+
static inline struct platform_device *of_platform_device_create(struct device_node *np,
91+
const char *bus_id,
92+
struct device *parent)
93+
{
94+
return NULL;
95+
}
96+
static inline int of_platform_device_destroy(struct device *dev, void *data)
97+
{
98+
return -ENODEV;
99+
}
100+
87101
static inline int of_platform_populate(struct device_node *root,
88102
const struct of_device_id *matches,
89103
const struct of_dev_auxdata *lookup,

0 commit comments

Comments
 (0)