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

of/platform: add function to populate default bus

When a default bus like the simple-bus should be used someone had to
call of_platform_populate() with the default match table. This match
table was not exported, so it is impossible for code build as a module
to use this. Instead of exporting of_default_bus_match_table, add a new
function which uses this default match table and populates the bus.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Hauke Mehrtens and committed by
Rob Herring
43443ad6 cebb053b

+18
+9
drivers/of/platform.c
··· 456 456 } 457 457 EXPORT_SYMBOL_GPL(of_platform_populate); 458 458 459 + int of_platform_default_populate(struct device_node *root, 460 + const struct of_dev_auxdata *lookup, 461 + struct device *parent) 462 + { 463 + return of_platform_populate(root, of_default_bus_match_table, lookup, 464 + parent); 465 + } 466 + EXPORT_SYMBOL_GPL(of_platform_default_populate); 467 + 459 468 static int of_platform_device_destroy(struct device *dev, void *data) 460 469 { 461 470 /* Do not touch devices not populated from the device tree */
+9
include/linux/of_platform.h
··· 72 72 const struct of_device_id *matches, 73 73 const struct of_dev_auxdata *lookup, 74 74 struct device *parent); 75 + extern int of_platform_default_populate(struct device_node *root, 76 + const struct of_dev_auxdata *lookup, 77 + struct device *parent); 75 78 extern void of_platform_depopulate(struct device *parent); 76 79 #else 77 80 static inline int of_platform_populate(struct device_node *root, 78 81 const struct of_device_id *matches, 79 82 const struct of_dev_auxdata *lookup, 80 83 struct device *parent) 84 + { 85 + return -ENODEV; 86 + } 87 + static inline int of_platform_default_populate(struct device_node *root, 88 + const struct of_dev_auxdata *lookup, 89 + struct device *parent) 81 90 { 82 91 return -ENODEV; 83 92 }