[PATCH] ppc64 PCI Hotplug: cleanup unsymmetric API routines

linas linas at austin.ibm.com
Thu Sep 29 10:33:38 EST 2005


This is a minor patch to the ppc64 PCI hotplug code; it makes the call to 
rpaphp_unconfig_pci_adapter() symmetric with respect to the call to 
rpaphp_config_pci_adapter().  I discussed this with John Rose, who
had provided the last round of changes for these functions; he 
appearently had this patch but somehow failed to mail it out.

Tested. (added/removed device).

Signed-off-by: Linas Vepstas <linas at austin.ibm.com>


Index: linux-2.6.14-rc2-git6/drivers/pci/hotplug/rpaphp_pci.c
===================================================================
--- linux-2.6.14-rc2-git6.orig/drivers/pci/hotplug/rpaphp_pci.c	2005-09-28 19:04:19.886691007 -0500
+++ linux-2.6.14-rc2-git6/drivers/pci/hotplug/rpaphp_pci.c	2005-09-28 19:11:16.134306452 -0500
@@ -319,20 +319,15 @@
 	return;
 }
 
-int rpaphp_unconfig_pci_adapter(struct slot *slot)
+int rpaphp_unconfig_pci_adapter(struct pci_bus *bus)
 {
 	struct pci_dev *dev, *tmp;
-	int retval = 0;
 
-	list_for_each_entry_safe(dev, tmp, slot->pci_devs, bus_list) {
+	list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
 		rpaphp_eeh_remove_bus_device(dev);
 		pci_remove_bus_device(dev);
 	}
-
-	slot->state = NOT_CONFIGURED;
-	info("%s: devices in slot[%s] unconfigured.\n", __FUNCTION__,
-	     slot->name);
-	return retval;
+	return 0;
 }
 
 static int setup_pci_hotplug_slot_info(struct slot *slot)
Index: linux-2.6.14-rc2-git6/drivers/pci/hotplug/rpaphp_core.c
===================================================================
--- linux-2.6.14-rc2-git6.orig/drivers/pci/hotplug/rpaphp_core.c	2005-09-28 19:04:19.886691007 -0500
+++ linux-2.6.14-rc2-git6/drivers/pci/hotplug/rpaphp_core.c	2005-09-28 19:11:16.135306311 -0500
@@ -426,8 +426,11 @@
 
 	dbg("DISABLING SLOT %s\n", slot->name);
 	down(&rpaphp_sem);
-	retval = rpaphp_unconfig_pci_adapter(slot);
+	retval = rpaphp_unconfig_pci_adapter(slot->bus);
 	up(&rpaphp_sem);
+	slot->state = NOT_CONFIGURED;
+	info("%s: devices in slot[%s] unconfigured.\n", __FUNCTION__,
+	     slot->name);
 exit:
 	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
 	return retval;
Index: linux-2.6.14-rc2-git6/drivers/pci/hotplug/rpaphp.h
===================================================================
--- linux-2.6.14-rc2-git6.orig/drivers/pci/hotplug/rpaphp.h	2005-09-28 19:04:19.886691007 -0500
+++ linux-2.6.14-rc2-git6/drivers/pci/hotplug/rpaphp.h	2005-09-28 19:11:16.136306171 -0500
@@ -92,9 +92,10 @@
 extern int rpaphp_claim_resource(struct pci_dev *dev, int resource);
 extern int rpaphp_enable_pci_slot(struct slot *slot);
 extern int register_pci_slot(struct slot *slot);
-extern int rpaphp_unconfig_pci_adapter(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
+
 extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
+extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);
 
 /* rpaphp_core.c */
 extern int rpaphp_add_slot(struct device_node *dn);



More information about the Linuxppc64-dev mailing list