summaryrefslogtreecommitdiffstats
path: root/drivers/of/of_private.h
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2017-10-17 16:36:26 -0700
committerRob Herring <robh@kernel.org>2017-10-17 20:47:14 -0500
commit24789c5ce5a373dd55640f9cd79117fcc3ccc46d (patch)
tree74f46e8ace25e756c8b26b9fa0b89907b21a78c6 /drivers/of/of_private.h
parent61b4de4e0b384f4a22c55c3bada604da49cec4e1 (diff)
downloadlinux-stable-24789c5ce5a373dd55640f9cd79117fcc3ccc46d.tar.gz
linux-stable-24789c5ce5a373dd55640f9cd79117fcc3ccc46d.tar.bz2
linux-stable-24789c5ce5a373dd55640f9cd79117fcc3ccc46d.zip
of: overlay: detect cases where device tree may become corrupt
When an attempt to apply an overlay changeset fails, an effort is made to revert any partial application of the changeset. When an attempt to remove an overlay changeset fails, an effort is made to re-apply any partial reversion of the changeset. The existing code does not check for failure to recover a failed overlay changeset application or overlay changeset revert. Add the missing checks and flag the devicetree as corrupt if the state of the devicetree can not be determined. Improve and expand the returned errors to more fully reflect the result of the effort to undo the partial effects of a failed attempt to apply or remove an overlay changeset. If the device tree might be corrupt, do not allow further attempts to apply or remove an overlay changeset. When creating an overlay changeset from an overlay device tree, add some additional warnings if the state of the overlay device tree is not as expected. Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/of_private.h')
-rw-r--r--drivers/of/of_private.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h
index 43df14f0cbce..36357f571df2 100644
--- a/drivers/of/of_private.h
+++ b/drivers/of/of_private.h
@@ -39,8 +39,12 @@ extern struct kset *of_kset;
extern int of_property_notify(int action, struct device_node *np,
struct property *prop, struct property *old_prop);
extern void of_node_release(struct kobject *kobj);
-extern int __of_changeset_apply(struct of_changeset *ocs);
-extern int __of_changeset_revert(struct of_changeset *ocs);
+extern int __of_changeset_apply_entries(struct of_changeset *ocs,
+ int *ret_revert);
+extern int __of_changeset_apply_notify(struct of_changeset *ocs);
+extern int __of_changeset_revert_entries(struct of_changeset *ocs,
+ int *ret_apply);
+extern int __of_changeset_revert_notify(struct of_changeset *ocs);
#else /* CONFIG_OF_DYNAMIC */
static inline int of_property_notify(int action, struct device_node *np,
struct property *prop, struct property *old_prop)