aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/hotplug/acpiphp_core.c3
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_core.c3
-rw-r--r--drivers/pci/hotplug/cpqphp_core.c3
-rw-r--r--drivers/pci/hotplug/fakephp.c3
-rw-r--r--drivers/pci/hotplug/ibmphp_ebda.c3
-rw-r--r--drivers/pci/hotplug/pci_hotplug_core.c15
-rw-r--r--drivers/pci/hotplug/pciehp_core.c3
-rw-r--r--drivers/pci/hotplug/rpaphp_slot.c2
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c3
-rw-r--r--drivers/pci/hotplug/shpchp_core.c3
-rw-r--r--include/linux/pci_hotplug.h3
11 files changed, 27 insertions, 17 deletions
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index 0e496e866a84..e9841765339f 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -340,7 +340,8 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
340 340
341 retval = pci_hp_register(slot->hotplug_slot, 341 retval = pci_hp_register(slot->hotplug_slot,
342 acpiphp_slot->bridge->pci_bus, 342 acpiphp_slot->bridge->pci_bus,
343 acpiphp_slot->device); 343 acpiphp_slot->device,
344 slot->name);
344 if (retval == -EBUSY) 345 if (retval == -EBUSY)
345 goto error_hpslot; 346 goto error_hpslot;
346 if (retval) { 347 if (retval) {
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 935947991dc9..5e5dee85763c 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -285,7 +285,8 @@ cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
285 info->attention_status = cpci_get_attention_status(slot); 285 info->attention_status = cpci_get_attention_status(slot);
286 286
287 dbg("registering slot %s", slot->hotplug_slot->name); 287 dbg("registering slot %s", slot->hotplug_slot->name);
288 status = pci_hp_register(slot->hotplug_slot, bus, i); 288 status = pci_hp_register(slot->hotplug_slot, bus, i,
289 slot->hotplug_slot->name);
289 if (status) { 290 if (status) {
290 err("pci_hp_register failed with error %d", status); 291 err("pci_hp_register failed with error %d", status);
291 goto error_name; 292 goto error_name;
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index 54defec51d08..a7fe4584f00b 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -436,7 +436,8 @@ static int ctrl_slot_setup(struct controller *ctrl,
436 slot_number); 436 slot_number);
437 result = pci_hp_register(hotplug_slot, 437 result = pci_hp_register(hotplug_slot,
438 ctrl->pci_dev->subordinate, 438 ctrl->pci_dev->subordinate,
439 slot->device); 439 slot->device,
440 hotplug_slot->name);
440 if (result) { 441 if (result) {
441 err("pci_hp_register failed with error %d\n", result); 442 err("pci_hp_register failed with error %d\n", result);
442 goto error_name; 443 goto error_name;
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
index 146ca9cd1567..3069f2153832 100644
--- a/drivers/pci/hotplug/fakephp.c
+++ b/drivers/pci/hotplug/fakephp.c
@@ -126,7 +126,8 @@ static int add_slot(struct pci_dev *dev)
126 slot->release = &dummy_release; 126 slot->release = &dummy_release;
127 slot->private = dslot; 127 slot->private = dslot;
128 128
129 retval = pci_hp_register(slot, dev->bus, PCI_SLOT(dev->devfn)); 129 retval = pci_hp_register(slot, dev->bus, PCI_SLOT(dev->devfn),
130 slot->name);
130 if (retval) { 131 if (retval) {
131 err("pci_hp_register failed with error %d\n", retval); 132 err("pci_hp_register failed with error %d\n", retval);
132 goto error_dslot; 133 goto error_dslot;
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
index 8cfd1c4926c8..342d3e8f77c8 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -966,7 +966,8 @@ static int __init ebda_rsrc_controller (void)
966 list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) { 966 list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) {
967 snprintf (tmp_slot->hotplug_slot->name, 30, "%s", create_file_name (tmp_slot)); 967 snprintf (tmp_slot->hotplug_slot->name, 30, "%s", create_file_name (tmp_slot));
968 pci_hp_register(tmp_slot->hotplug_slot, 968 pci_hp_register(tmp_slot->hotplug_slot,
969 pci_find_bus(0, tmp_slot->bus), tmp_slot->device); 969 pci_find_bus(0, tmp_slot->bus), tmp_slot->device,
970 tmp_slot->hotplug_slot->name);
970 } 971 }
971 972
972 print_ebda_hpc (); 973 print_ebda_hpc ();
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index 2e6c4474644e..02b1ae12a2e6 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -547,13 +547,15 @@ out:
547 * @bus: bus this slot is on 547 * @bus: bus this slot is on
548 * @slot: pointer to the &struct hotplug_slot to register 548 * @slot: pointer to the &struct hotplug_slot to register
549 * @slot_nr: slot number 549 * @slot_nr: slot number
550 * @name: name registered with kobject core
550 * 551 *
551 * Registers a hotplug slot with the pci hotplug subsystem, which will allow 552 * Registers a hotplug slot with the pci hotplug subsystem, which will allow
552 * userspace interaction to the slot. 553 * userspace interaction to the slot.
553 * 554 *
554 * Returns 0 if successful, anything else for an error. 555 * Returns 0 if successful, anything else for an error.
555 */ 556 */
556int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr) 557int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr,
558 const char *name)
557{ 559{
558 int result; 560 int result;
559 struct pci_slot *pci_slot; 561 struct pci_slot *pci_slot;
@@ -569,7 +571,7 @@ int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr)
569 } 571 }
570 572
571 /* Check if we have already registered a slot with the same name. */ 573 /* Check if we have already registered a slot with the same name. */
572 if (get_slot_from_name(slot->name)) 574 if (get_slot_from_name(name))
573 return -EEXIST; 575 return -EEXIST;
574 576
575 /* 577 /*
@@ -577,7 +579,7 @@ int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr)
577 * driver and call it here again. If we've already created the 579 * driver and call it here again. If we've already created the
578 * pci_slot, the interface will simply bump the refcount. 580 * pci_slot, the interface will simply bump the refcount.
579 */ 581 */
580 pci_slot = pci_create_slot(bus, slot_nr, slot->name); 582 pci_slot = pci_create_slot(bus, slot_nr, name);
581 if (IS_ERR(pci_slot)) 583 if (IS_ERR(pci_slot))
582 return PTR_ERR(pci_slot); 584 return PTR_ERR(pci_slot);
583 585
@@ -593,8 +595,8 @@ int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr)
593 /* 595 /*
594 * Allow pcihp drivers to override the ACPI_PCI_SLOT name. 596 * Allow pcihp drivers to override the ACPI_PCI_SLOT name.
595 */ 597 */
596 if (strcmp(kobject_name(&pci_slot->kobj), slot->name)) { 598 if (strcmp(kobject_name(&pci_slot->kobj), name)) {
597 result = kobject_rename(&pci_slot->kobj, slot->name); 599 result = kobject_rename(&pci_slot->kobj, name);
598 if (result) { 600 if (result) {
599 pci_destroy_slot(pci_slot); 601 pci_destroy_slot(pci_slot);
600 return result; 602 return result;
@@ -607,8 +609,7 @@ int pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, int slot_nr)
607 609
608 result = fs_add_slot(pci_slot); 610 result = fs_add_slot(pci_slot);
609 kobject_uevent(&pci_slot->kobj, KOBJ_ADD); 611 kobject_uevent(&pci_slot->kobj, KOBJ_ADD);
610 dbg("Added slot %s to the list\n", slot->name); 612 dbg("Added slot %s to the list\n", name);
611
612 613
613 return result; 614 return result;
614} 615}
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index c748a19db89d..3ace5e057601 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -226,7 +226,8 @@ static int init_slots(struct controller *ctrl)
226duplicate_name: 226duplicate_name:
227 retval = pci_hp_register(hotplug_slot, 227 retval = pci_hp_register(hotplug_slot,
228 ctrl->pci_dev->subordinate, 228 ctrl->pci_dev->subordinate,
229 slot->device); 229 slot->device,
230 slot->name);
230 if (retval) { 231 if (retval) {
231 /* 232 /*
232 * If slot N already exists, we'll try to create 233 * If slot N already exists, we'll try to create
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index 50884507b8be..736d3b43ed0b 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -137,7 +137,7 @@ int rpaphp_register_slot(struct slot *slot)
137 slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn); 137 slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn);
138 else 138 else
139 slotno = -1; 139 slotno = -1;
140 retval = pci_hp_register(php_slot, slot->bus, slotno); 140 retval = pci_hp_register(php_slot, slot->bus, slotno, slot->name);
141 if (retval) { 141 if (retval) {
142 err("pci_hp_register failed with error %d\n", retval); 142 err("pci_hp_register failed with error %d\n", retval);
143 return retval; 143 return retval;
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index 410fe0394a8e..6d20bbd4359a 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -653,7 +653,8 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
653 bss_hotplug_slot->ops = &sn_hotplug_slot_ops; 653 bss_hotplug_slot->ops = &sn_hotplug_slot_ops;
654 bss_hotplug_slot->release = &sn_release_slot; 654 bss_hotplug_slot->release = &sn_release_slot;
655 655
656 rc = pci_hp_register(bss_hotplug_slot, pci_bus, device); 656 rc = pci_hp_register(bss_hotplug_slot, pci_bus, device,
657 bss_hotplug_slot->name);
657 if (rc) 658 if (rc)
658 goto register_err; 659 goto register_err;
659 660
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index cc38615395f1..bf5096612aab 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -146,7 +146,8 @@ static int init_slots(struct controller *ctrl)
146 slot->hp_slot, slot->number, ctrl->slot_device_offset); 146 slot->hp_slot, slot->number, ctrl->slot_device_offset);
147duplicate_name: 147duplicate_name:
148 retval = pci_hp_register(slot->hotplug_slot, 148 retval = pci_hp_register(slot->hotplug_slot,
149 ctrl->pci_dev->subordinate, slot->device); 149 ctrl->pci_dev->subordinate, slot->device,
150 hotplug_slot->name);
150 if (retval) { 151 if (retval) {
151 /* 152 /*
152 * If slot N already exists, we'll try to create 153 * If slot N already exists, we'll try to create
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index a08cd06b541a..5efba6671865 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -165,7 +165,8 @@ struct hotplug_slot {
165}; 165};
166#define to_hotplug_slot(n) container_of(n, struct hotplug_slot, kobj) 166#define to_hotplug_slot(n) container_of(n, struct hotplug_slot, kobj)
167 167
168extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr); 168extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr,
169 const char *name);
169extern int pci_hp_deregister(struct hotplug_slot *slot); 170extern int pci_hp_deregister(struct hotplug_slot *slot);
170extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 171extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
171 struct hotplug_slot_info *info); 172 struct hotplug_slot_info *info);