diff options
author | Pantelis Antoniou <pantelis.antoniou@konsulko.com> | 2014-07-04 18:58:46 +0200 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-07-16 16:16:52 +0200 |
commit | d8c50088417ebf61ad8b132caad20d10f7736034 (patch) | |
tree | 40f3105ec3c03601e22301f36d207362e6d1226e /drivers/of/of_private.h | |
parent | OF: Utility helper functions for dynamic nodes (diff) | |
download | linux-d8c50088417ebf61ad8b132caad20d10f7736034.tar.xz linux-d8c50088417ebf61ad8b132caad20d10f7736034.zip |
of: Create unlocked versions of node and property add/remove functions
The DT overlay code will need to manipulate nodes and properties while
already holding the devicetree lock, or on nodes that are not yet
attached to the tree, but the current helper functions don't allow that.
Extract the core behaviour from the accessors and create the following
unlocked variants.
The unlocked variants require either the lock to already be held or for
the nodes to be detached from the tree. Changes to live nodes will not
get updated in sysfs, so the caller must arrange for housekeeping to
take place after dropping the lock.
The new functions are: __of_add_property(), __of_remove_property(),
__of_update_property(), __of_attach_node() and __of_detach_node().
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[Remove unnecessary diff hunks and rewrite commit text]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of/of_private.h')
-rw-r--r-- | drivers/of/of_private.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index 1799ed2b3808..0f6089722af9 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -61,4 +61,12 @@ static inline int of_property_notify(int action, struct device_node *np, struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags); struct device_node *__of_node_alloc(const char *full_name, gfp_t allocflags); +extern int __of_add_property(struct device_node *np, struct property *prop); +extern int __of_remove_property(struct device_node *np, struct property *prop); +extern int __of_update_property(struct device_node *np, + struct property *newprop, struct property **oldprop); + +extern void __of_attach_node(struct device_node *np); +extern void __of_detach_node(struct device_node *np); + #endif /* _LINUX_OF_PRIVATE_H */ |