Commit 73aca58b authored by Rob Herring's avatar Rob Herring

of: Move of_platform_register_reconfig_notifier() into DT core

There's no reason the generic platform bus code needs to call
of_platform_register_reconfig_notifier(). The notifier can be setup
before the platform bus is. Let's move it into of_core_init() which is
called just before platform_bus_init() instead to keep more of the DT
bits in the DT code.
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230717143718.1715773-1-robh@kernel.orgSigned-off-by: default avatarRob Herring <robh@kernel.org>
parent 3e821506
...@@ -1528,6 +1528,6 @@ int __init platform_bus_init(void) ...@@ -1528,6 +1528,6 @@ int __init platform_bus_init(void)
error = bus_register(&platform_bus_type); error = bus_register(&platform_bus_type);
if (error) if (error)
device_unregister(&platform_bus); device_unregister(&platform_bus);
of_platform_register_reconfig_notifier();
return error; return error;
} }
...@@ -167,6 +167,7 @@ void __init of_core_init(void) ...@@ -167,6 +167,7 @@ void __init of_core_init(void)
{ {
struct device_node *np; struct device_node *np;
of_platform_register_reconfig_notifier();
/* Create the kset, and register existing nodes */ /* Create the kset, and register existing nodes */
mutex_lock(&of_mutex); mutex_lock(&of_mutex);
......
...@@ -60,6 +60,12 @@ static inline int of_property_notify(int action, struct device_node *np, ...@@ -60,6 +60,12 @@ static inline int of_property_notify(int action, struct device_node *np,
} }
#endif /* CONFIG_OF_DYNAMIC */ #endif /* CONFIG_OF_DYNAMIC */
#if defined(CONFIG_OF_DYNAMIC) && defined(CONFIG_OF_ADDRESS)
void of_platform_register_reconfig_notifier(void);
#else
static inline void of_platform_register_reconfig_notifier(void) { }
#endif
#if defined(CONFIG_OF_KOBJ) #if defined(CONFIG_OF_KOBJ)
int of_node_is_attached(const struct device_node *node); int of_node_is_attached(const struct device_node *node);
int __of_add_property_sysfs(struct device_node *np, struct property *pp); int __of_add_property_sysfs(struct device_node *np, struct property *pp);
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include "of_private.h"
const struct of_device_id of_default_bus_match_table[] = { const struct of_device_id of_default_bus_match_table[] = {
{ .compatible = "simple-bus", }, { .compatible = "simple-bus", },
{ .compatible = "simple-mfd", }, { .compatible = "simple-mfd", },
......
...@@ -127,10 +127,4 @@ static inline int devm_of_platform_populate(struct device *dev) ...@@ -127,10 +127,4 @@ static inline int devm_of_platform_populate(struct device *dev)
static inline void devm_of_platform_depopulate(struct device *dev) { } static inline void devm_of_platform_depopulate(struct device *dev) { }
#endif #endif
#if defined(CONFIG_OF_DYNAMIC) && defined(CONFIG_OF_ADDRESS)
extern void of_platform_register_reconfig_notifier(void);
#else
static inline void of_platform_register_reconfig_notifier(void) { }
#endif
#endif /* _LINUX_OF_PLATFORM_H */ #endif /* _LINUX_OF_PLATFORM_H */
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