diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/pci_hotplug_core.c | 16 | ||||
-rw-r--r-- | drivers/pci/hotplug/sgi_hotplug.c | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 4df31f375197..b3b2d8cf4370 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c | |||
@@ -572,6 +572,11 @@ int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr) | |||
572 | if (tmp) | 572 | if (tmp) |
573 | return -EEXIST; | 573 | return -EEXIST; |
574 | 574 | ||
575 | /* | ||
576 | * No problems if we call this interface from both ACPI_PCI_SLOT | ||
577 | * driver and call it here again. If we've already created the | ||
578 | * pci_slot, the interface will simply bump the refcount. | ||
579 | */ | ||
575 | pci_slot = pci_create_slot(bus, slot_nr, slot->name); | 580 | pci_slot = pci_create_slot(bus, slot_nr, slot->name); |
576 | if (IS_ERR(pci_slot)) | 581 | if (IS_ERR(pci_slot)) |
577 | return PTR_ERR(pci_slot); | 582 | return PTR_ERR(pci_slot); |
@@ -585,6 +590,17 @@ int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr) | |||
585 | slot->pci_slot = pci_slot; | 590 | slot->pci_slot = pci_slot; |
586 | pci_slot->hotplug = slot; | 591 | pci_slot->hotplug = slot; |
587 | 592 | ||
593 | /* | ||
594 | * Allow pcihp drivers to override the ACPI_PCI_SLOT name. | ||
595 | */ | ||
596 | if (strcmp(kobject_name(&pci_slot->kobj), slot->name)) { | ||
597 | result = kobject_rename(&pci_slot->kobj, slot->name); | ||
598 | if (result) { | ||
599 | pci_destroy_slot(pci_slot); | ||
600 | return result; | ||
601 | } | ||
602 | } | ||
603 | |||
588 | spin_lock(&pci_hotplug_slot_list_lock); | 604 | spin_lock(&pci_hotplug_slot_list_lock); |
589 | list_add(&slot->slot_list, &pci_hotplug_slot_list); | 605 | list_add(&slot->slot_list, &pci_hotplug_slot_list); |
590 | spin_unlock(&pci_hotplug_slot_list_lock); | 606 | spin_unlock(&pci_hotplug_slot_list_lock); |
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c index 2036a43ff2fd..410fe0394a8e 100644 --- a/drivers/pci/hotplug/sgi_hotplug.c +++ b/drivers/pci/hotplug/sgi_hotplug.c | |||
@@ -668,7 +668,7 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus) | |||
668 | 668 | ||
669 | register_err: | 669 | register_err: |
670 | dev_dbg(&pci_bus->self->dev, "bus failed to register with err = %d\n", | 670 | dev_dbg(&pci_bus->self->dev, "bus failed to register with err = %d\n", |
671 | rc); | 671 | rc); |
672 | 672 | ||
673 | alloc_err: | 673 | alloc_err: |
674 | if (rc == -ENOMEM) | 674 | if (rc == -ENOMEM) |