Merge tag 'x86_urgent_for_v5.16_rc1' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / pci / hotplug / rpadlpar_core.c
index f979b70..0a3c80b 100644 (file)
@@ -40,13 +40,13 @@ static DEFINE_MUTEX(rpadlpar_mutex);
 static struct device_node *find_vio_slot_node(char *drc_name)
 {
        struct device_node *parent = of_find_node_by_name(NULL, "vdevice");
-       struct device_node *dn = NULL;
+       struct device_node *dn;
        int rc;
 
        if (!parent)
                return NULL;
 
-       while ((dn = of_get_next_child(parent, dn))) {
+       for_each_child_of_node(parent, dn) {
                rc = rpaphp_check_drc_props(dn, drc_name, NULL);
                if (rc == 0)
                        break;
@@ -60,10 +60,10 @@ static struct device_node *find_vio_slot_node(char *drc_name)
 static struct device_node *find_php_slot_pci_node(char *drc_name,
                                                  char *drc_type)
 {
-       struct device_node *np = NULL;
+       struct device_node *np;
        int rc;
 
-       while ((np = of_find_node_by_name(np, "pci"))) {
+       for_each_node_by_name(np, "pci") {
                rc = rpaphp_check_drc_props(np, drc_name, drc_type);
                if (rc == 0)
                        break;