[PATCH] PCI Hotplug: rpaphp: Purify hotplug

Currently rpaphp registers the following bus types as hotplug slots:
1) Actual PCI Hotplug slots
2) Embedded/Internal PCI slots
3) PCI Host Bridges

The second and third bus types are not actually direct parents of
removable adapters.  As such, the rpaphp has special case code to fake
results for attributes like power, adapter status, etc.  This patch
removes types 2 and 3 from the rpaphp module.

This patch also changes the DLPAR module so that slots can be
DLPAR-added/removed without having been designated as hotplug-capable.

Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index f2f1cd0..17a0279 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -49,13 +49,14 @@
 	return child;
 }
 
-static struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn)
+struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn)
 {
 	if (!dn->phb || !dn->phb->bus)
 		return NULL;
 
 	return find_bus_among_children(dn->phb->bus, dn);
 }
+EXPORT_SYMBOL_GPL(rpaphp_find_pci_bus);
 
 int rpaphp_claim_resource(struct pci_dev *dev, int resource)
 {
@@ -129,10 +130,8 @@
 	if (rc)
 		goto exit;
 
- 	if ((state == EMPTY) || (slot->type == PHB)) {
- 		dbg("slot is empty\n");
+ 	if (state == EMPTY)
  		*value = EMPTY;
- 	}
  	else if (state == PRESENT) {
 		if (!is_init) {
 			/* at run-time slot->state can be changed by */
@@ -423,10 +422,6 @@
 {
 	int rc = -EINVAL;
 
-	if ((slot->type == EMBEDDED) || (slot->type == PHB))
-		slot->removable = 0;
-	else
-		slot->removable = 1;
 	if (setup_pci_hotplug_slot_info(slot))
 		goto exit_rc;
 	if (setup_pci_slot(slot))