[RFC PATCH 3/3] of: dynamic: add device links barrier before detach

Michael Auchter
2020-10-14T19:36:43Z

Signed-off-by: Michael Auchter <michael.auchter@ni.com>
---
drivers/of/dynamic.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 7478bfc8d440..a4e2881524e9 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -14,6 +14,7 @@
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/proc_fs.h>
+#include <linux/device.h>

#include "of_private.h"

@@ -688,6 +689,8 @@ void of_changeset_destroy(struct of_changeset *ocs)
{
struct of_changeset_entry *ce, *cen;

+ device_links_barrier();
+
list_for_each_entry_safe_reverse(ce, cen, &ocs->entries, node)
__of_changeset_entry_destroy(ce);
}
--
2.25.4