diff options
author | Rob Herring <robh@kernel.org> | 2017-10-04 14:09:40 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2017-10-16 13:37:38 -0500 |
commit | b56b5528f5b3c3d47e7c0ca67318c45e980d93f0 (patch) | |
tree | 6c97fc5ee0bb26a4f3c762218a6b351ad3955c8a /drivers/of/of_private.h | |
parent | 0c3c234b95fa7f1dfa19e1456a47ebafc300dd6b (diff) | |
download | linux-b56b5528f5b3c3d47e7c0ca67318c45e980d93f0.tar.gz linux-b56b5528f5b3c3d47e7c0ca67318c45e980d93f0.tar.bz2 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/of_private.h')
-rw-r--r-- | drivers/of/of_private.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index cc86a974f35f..43df14f0cbce 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -49,6 +49,29 @@ static inline int of_property_notify(int action, struct device_node *np, } #endif /* CONFIG_OF_DYNAMIC */ +#if defined(CONFIG_OF_KOBJ) +int of_node_is_attached(struct device_node *node); +int __of_add_property_sysfs(struct device_node *np, struct property *pp); +void __of_remove_property_sysfs(struct device_node *np, struct property *prop); +void __of_update_property_sysfs(struct device_node *np, struct property *newprop, + struct property *oldprop); +int __of_attach_node_sysfs(struct device_node *np); +void __of_detach_node_sysfs(struct device_node *np); +#else +static inline int __of_add_property_sysfs(struct device_node *np, struct property *pp) +{ + return 0; +} +static inline void __of_remove_property_sysfs(struct device_node *np, struct property *prop) {} +static inline void __of_update_property_sysfs(struct device_node *np, + struct property *newprop, struct property *oldprop) {} +static inline int __of_attach_node_sysfs(struct device_node *np) +{ + return 0; +} +static inline void __of_detach_node_sysfs(struct device_node *np) {} +#endif + #if defined(CONFIG_OF_UNITTEST) && defined(CONFIG_OF_OVERLAY) extern void __init unittest_unflatten_overlay_base(void); #else |