To maintain consistency with software_node_unregister_nodes(), reverse
the order in which the software_node_unregister_node_group() function
unregisters nodes.

Suggested-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>
Signed-off-by: Daniel Scally <djrsca...@gmail.com>
---
Changes since v3:

        Patch introduced

 drivers/base/swnode.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index d39e1c76d98d..9bd0bb77ad5b 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -782,7 +782,10 @@ void software_node_unregister_node_group(const struct 
software_node **node_group
        if (!node_group)
                return;
 
-       for (i = 0; node_group[i]; i++)
+       while (node_group[i]->name)
+               i++;
+
+       while (i--)
                software_node_unregister(node_group[i]);
 }
 EXPORT_SYMBOL_GPL(software_node_unregister_node_group);
-- 
2.25.1

Reply via email to