diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c index e22d023f91d1bd2b3b7514403c31ec4d406fc2ba..754c3f23282e34b04d3865ea3f1e18ce38e3a491 100644 --- a/drivers/pci/hotplug/ibmphp_pci.c +++ b/drivers/pci/hotplug/ibmphp_pci.c @@ -294,7 +294,6 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) default: err("MAJOR PROBLEM!!!!, header type not supported? %x\n", hdr_type); return -ENXIO; - break; } /* end of switch */ } /* end of valid device */ } /* end of for */ @@ -1509,7 +1508,6 @@ static int unconfigure_boot_card(struct slot *slot_cur) default: err("MAJOR PROBLEM!!!! Cannot read device's header\n"); return -1; - break; } /* end of switch */ } /* end of valid device */ } /* end of for */ diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 3861505741e6d5104e3d3a4b8a02ae576d0df104..ed2077e7470aef1e232929dd28daf47df66c41ca 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c @@ -272,6 +272,9 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, goto err; } + INIT_LIST_HEAD(&slot->list); + list_add(&slot->list, &parent->slots); + err = kobject_init_and_add(&slot->kobj, &pci_slot_ktype, NULL, "%s", slot_name); if (err) { @@ -279,9 +282,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, goto err; } - INIT_LIST_HEAD(&slot->list); - list_add(&slot->list, &parent->slots); - down_read(&pci_bus_sem); list_for_each_entry(dev, &parent->devices, bus_list) if (PCI_SLOT(dev->devfn) == slot_nr)