diff options
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/rpadlpar_core.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index 72383467a0d5..4d74f0b6079f 100644 --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c | |||
@@ -98,7 +98,15 @@ static struct device_node *find_dlpar_node(char *drc_name, int *node_type) | |||
98 | return NULL; | 98 | return NULL; |
99 | } | 99 | } |
100 | 100 | ||
101 | static struct slot *find_slot(struct device_node *dn) | 101 | /** |
102 | * find_php_slot - return hotplug slot structure for device node | ||
103 | * | ||
104 | * This routine will return the hotplug slot structure | ||
105 | * for a given device node. Note that built-in PCI slots | ||
106 | * may be dlpar-able, but not hot-pluggable, so this routine | ||
107 | * will return NULL for built-in PCI slots. | ||
108 | */ | ||
109 | static struct slot *find_php_slot(struct device_node *dn) | ||
102 | { | 110 | { |
103 | struct list_head *tmp, *n; | 111 | struct list_head *tmp, *n; |
104 | struct slot *slot; | 112 | struct slot *slot; |
@@ -224,9 +232,9 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn) | |||
224 | if (!pcibios_find_pci_bus(dn)) | 232 | if (!pcibios_find_pci_bus(dn)) |
225 | return -EINVAL; | 233 | return -EINVAL; |
226 | 234 | ||
227 | slot = find_slot(dn); | 235 | /* If pci slot is hotplugable, use hotplug to remove it */ |
236 | slot = find_php_slot(dn); | ||
228 | if (slot) { | 237 | if (slot) { |
229 | /* Remove hotplug slot */ | ||
230 | if (rpaphp_deregister_slot(slot)) { | 238 | if (rpaphp_deregister_slot(slot)) { |
231 | printk(KERN_ERR | 239 | printk(KERN_ERR |
232 | "%s: unable to remove hotplug slot %s\n", | 240 | "%s: unable to remove hotplug slot %s\n", |
@@ -370,9 +378,9 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn) | |||
370 | if (!bus) | 378 | if (!bus) |
371 | return -EINVAL; | 379 | return -EINVAL; |
372 | 380 | ||
373 | slot = find_slot(dn); | 381 | /* If pci slot is hotplugable, use hotplug to remove it */ |
382 | slot = find_php_slot(dn); | ||
374 | if (slot) { | 383 | if (slot) { |
375 | /* Remove hotplug slot */ | ||
376 | if (rpaphp_deregister_slot(slot)) { | 384 | if (rpaphp_deregister_slot(slot)) { |
377 | printk(KERN_ERR | 385 | printk(KERN_ERR |
378 | "%s: unable to remove hotplug slot %s\n", | 386 | "%s: unable to remove hotplug slot %s\n", |