linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 17/19] PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically
@ 2007-04-03 17:31 Linas Vepstas
  2007-05-07  5:09 ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Linas Vepstas @ 2007-04-03 17:31 UTC (permalink / raw)
  To: Kristen Carlson Accardi; +Cc: Andrew Morton, linuxppc-dev, pcihpd-discuss


At first blush, the disable_slot() routine does not look
at all like its symmetric with the enable_slot() routine;
as it seems to call a very different set of routines.
However, this is easily fixed: pcibios_remove_pci_devices()
does the right thing.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>

----

 drivers/pci/hotplug/rpaphp_core.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Index: linux-2.6.21-rc4-git4/drivers/pci/hotplug/rpaphp_core.c
===================================================================
--- linux-2.6.21-rc4-git4.orig/drivers/pci/hotplug/rpaphp_core.c	2007-04-03 11:04:41.000000000 -0500
+++ linux-2.6.21-rc4-git4/drivers/pci/hotplug/rpaphp_core.c	2007-04-03 11:04:47.000000000 -0500
@@ -424,18 +424,12 @@ static int enable_slot(struct hotplug_sl
 	return retval;
 }
 
-static int __disable_slot(struct slot *slot)
+static inline int __disable_slot(struct slot *slot)
 {
-	struct pci_dev *dev, *tmp;
-
 	if (slot->state == NOT_CONFIGURED)
 		return -EINVAL;
 
-	list_for_each_entry_safe(dev, tmp, &slot->bus->devices, bus_list) {
-		eeh_remove_bus_device(dev);
-		pci_remove_bus_device(dev);
-	}
-
+	pcibios_remove_pci_devices(slot->bus);
 	slot->state = NOT_CONFIGURED;
 	return 0;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH 0/19]: RPAPHP pci hotplug cleanup patchbomb
@ 2007-04-03  0:26 Linas Vepstas
  2007-04-03  0:49 ` [PATCH 17/19] PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically Linas Vepstas
  0 siblings, 1 reply; 4+ messages in thread
From: Linas Vepstas @ 2007-04-03  0:26 UTC (permalink / raw)
  To: Greg KH; +Cc: Andrew Morton, linuxppc-dev, linux-pci


Hi Greg, 

Please queue these cleanp patches for 2.6.22; cc'ing akpm.

This is a collection of very small patches that clean up various bits and 
pieces of the RPAPHP hotplug code. They eliminate about 100 lines of code, 
almost without changing any function; there are a few minor bugfixes to 
various error paths, and one memleak fix. Some documentation is added.
The result is, I beleive, slightly more readable, easier to understand
code. In particular, the enable/disable add/remove code paths are now
more obviously symmetrical in thier function.

--linas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-07 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-03 17:31 [PATCH 17/19] PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically Linas Vepstas
2007-05-07  5:09 ` Michael Ellerman
2007-05-07 17:04   ` Linas Vepstas
  -- strict thread matches above, loose matches on Subject: below --
2007-04-03  0:26 [PATCH 0/19]: RPAPHP pci hotplug cleanup patchbomb Linas Vepstas
2007-04-03  0:49 ` [PATCH 17/19] PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically Linas Vepstas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).