[PATCH 17/19] PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically

Michael Ellerman michael at ellerman.id.au
Mon May 7 15:09:14 EST 2007


On Tue, 2007-04-03 at 12:31 -0500, Linas Vepstas wrote:
> 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 at austin.ibm.com>
> Cc: John Rose <johnrose at 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);

You need to add an EXPORT_SYMBOL() for this.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070507/a45eeb43/attachment.pgp>


More information about the Linuxppc-dev mailing list