aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 71a2cb8baa4a..f6c05f3621ca 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -299,32 +299,32 @@ int rpaphp_add_slot(struct device_node *dn)
299 const int *indexes, *names, *types, *power_domains; 299 const int *indexes, *names, *types, *power_domains;
300 char *name, *type; 300 char *name, *type;
301 301
302 if (!dn->name || strcmp(dn->name, "pci"))
303 return 0;
304
305 if (!is_php_dn(dn, &indexes, &names, &types, &power_domains))
306 return 0;
307
302 dbg("Entry %s: dn->full_name=%s\n", __FUNCTION__, dn->full_name); 308 dbg("Entry %s: dn->full_name=%s\n", __FUNCTION__, dn->full_name);
303 309
304 /* register PCI devices */ 310 /* register PCI devices */
305 if (dn->name != 0 && strcmp(dn->name, "pci") == 0) { 311 name = (char *) &names[1];
306 if (!is_php_dn(dn, &indexes, &names, &types, &power_domains)) 312 type = (char *) &types[1];
307 goto exit; 313 for (i = 0; i < indexes[0]; i++) {
308 314
309 name = (char *) &names[1]; 315 slot = alloc_slot_struct(dn, indexes[i + 1], name, power_domains[i + 1]);
310 type = (char *) &types[1]; 316 if (!slot)
311 for (i = 0; i < indexes[0]; i++, 317 return -ENOMEM;
312 name += (strlen(name) + 1), type += (strlen(type) + 1)) { 318
313 319 slot->type = simple_strtoul(type, NULL, 10);
314 if (!(slot = alloc_slot_struct(dn, indexes[i + 1], name,
315 power_domains[i + 1]))) {
316 retval = -ENOMEM;
317 goto exit;
318 }
319 slot->type = simple_strtoul(type, NULL, 10);
320 320
321 dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n", 321 dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
322 indexes[i + 1], name, type); 322 indexes[i + 1], name, type);
323 323
324 retval = rpaphp_register_pci_slot(slot); 324 retval = rpaphp_register_pci_slot(slot);
325 } 325 name += strlen(name) + 1;
326 type += strlen(type) + 1;
326 } 327 }
327exit:
328 dbg("%s - Exit: num_slots=%d rc[%d]\n", 328 dbg("%s - Exit: num_slots=%d rc[%d]\n",
329 __FUNCTION__, num_slots, retval); 329 __FUNCTION__, num_slots, retval);
330 return retval; 330 return retval;