summaryrefslogtreecommitdiff
path: root/drivers/of/overlay.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2018-07-29 13:35:45 +0300
committerWolfram Sang <wsa@the-dreams.de>2018-07-29 13:35:45 +0300
commitb1d2b0a43d288836bce5e708b88981e2df0bf594 (patch)
tree1129478b713c33186fc10c50f84f9eed8f931ea2 /drivers/of/overlay.c
parent3b770017b03a4cdfde0b61a49b4801dc8cca9f69 (diff)
parenta2b3bf4846e5eed62ea6abb096af2c950961033c (diff)
downloadlinux-b1d2b0a43d288836bce5e708b88981e2df0bf594.tar.xz
Merge tag 'at24-4.19-updates-for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-4.19
at24: updates for v4.19 New property: 'address-width' which allows to specify the number of addressing bits. Up until now we only could choose one of the defined models and rely on the flags specified in its corresponding chip data structure.
Diffstat (limited to 'drivers/of/overlay.c')
-rw-r--r--drivers/of/overlay.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 7baa53e5b1d7..eda57ef12fd0 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -804,6 +804,8 @@ static int of_overlay_apply(const void *fdt, struct device_node *tree,
goto err_free_overlay_changeset;
}
+ of_populate_phandle_cache();
+
ret = __of_changeset_apply_notify(&ovcs->cset);
if (ret)
pr_err("overlay changeset entry notify error %d\n", ret);
@@ -1046,8 +1048,17 @@ int of_overlay_remove(int *ovcs_id)
list_del(&ovcs->ovcs_list);
+ /*
+ * Disable phandle cache. Avoids race condition that would arise
+ * from removing cache entry when the associated node is deleted.
+ */
+ of_free_phandle_cache();
+
ret_apply = 0;
ret = __of_changeset_revert_entries(&ovcs->cset, &ret_apply);
+
+ of_populate_phandle_cache();
+
if (ret) {
if (ret_apply)
devicetree_state_flags |= DTSF_REVERT_FAIL;