diff options
author | Rob Herring <robh@kernel.org> | 2017-10-04 21:09:40 +0200 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2017-10-16 20:37:38 +0200 |
commit | b56b5528f5b3c3d47e7c0ca67318c45e980d93f0 (patch) | |
tree | 6c97fc5ee0bb26a4f3c762218a6b351ad3955c8a /drivers/of/dynamic.c | |
parent | of: wrap accesses to device_node kobject (diff) | |
download | linux-b56b5528f5b3c3d47e7c0ca67318c45e980d93f0.tar.xz linux-b56b5528f5b3c3d47e7c0ca67318c45e980d93f0.zip |
of: make kobject and bin_attribute support configurable
Having device_nodes be kobjects is only needed if sysfs or OF_DYNAMIC is
enabled. Otherwise, having a kobject in struct device_node is
unnecessary bloat in minimal kernel configurations.
Likewise, bin_attribute is only needed in struct property when sysfs is
enabled, so we can make it configurable too.
Tested-by: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/dynamic.c')
-rw-r--r-- | drivers/of/dynamic.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 9d6ba18c529f..39e8cf731764 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -48,28 +48,6 @@ void of_node_put(struct device_node *node) } EXPORT_SYMBOL(of_node_put); -void __of_detach_node_sysfs(struct device_node *np) -{ - struct property *pp; - - if (!IS_ENABLED(CONFIG_SYSFS)) - return; - - BUG_ON(!of_node_is_initialized(np)); - if (!of_kset) - return; - - /* only remove properties if on sysfs */ - if (of_node_is_attached(np)) { - for_each_property_of_node(np, pp) - __of_sysfs_remove_bin_file(np, pp); - kobject_del(&np->kobj); - } - - /* finally remove the kobj_init ref */ - of_node_put(np); -} - static BLOCKING_NOTIFIER_HEAD(of_reconfig_chain); int of_reconfig_notifier_register(struct notifier_block *nb) |