Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20220630123445.v24.1.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Matthias Kaehlcke and committed by
Greg Kroah-Hartman
620e8e8b 1742b765

+18 -4
+18 -4
include/linux/of_platform.h
··· 61 61 } 62 62 #endif 63 63 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 64 69 /* Platform devices and busses creation */ 65 70 extern struct platform_device *of_platform_device_create(struct device_node *np, 66 71 const char *bus_id, 67 72 struct device *parent); 68 73 69 74 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 + 74 76 extern int of_platform_populate(struct device_node *root, 75 77 const struct of_device_id *matches, 76 78 const struct of_dev_auxdata *lookup, ··· 86 84 87 85 extern void devm_of_platform_depopulate(struct device *dev); 88 86 #else 87 + /* Platform devices and busses creation */ 88 + static inline struct platform_device *of_platform_device_create(struct device_node *np, 89 + const char *bus_id, 90 + struct device *parent) 91 + { 92 + return NULL; 93 + } 94 + static inline int of_platform_device_destroy(struct device *dev, void *data) 95 + { 96 + return -ENODEV; 97 + } 98 + 89 99 static inline int of_platform_populate(struct device_node *root, 90 100 const struct of_device_id *matches, 91 101 const struct of_dev_auxdata *lookup,