PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_device

The old pci_remove_bus_device actually did stop and remove.

Make the name reflect that to reduce confusion.

This patch is done by sed scripts and changes back some incorrect
__pci_remove_bus_device changes.

Suggested-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
Yinghai Lu 2012-02-25 13:54:20 -08:00 committed by Jesse Barnes
parent 3cf8b64380
commit 210647af89
22 changed files with 31 additions and 31 deletions

View File

@ -134,11 +134,11 @@ static void ixdp2400_pci_postinit(void)
if (ixdp2x00_master_npu()) { if (ixdp2x00_master_npu()) {
dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN); dev = pci_get_bus_and_slot(1, IXDP2400_SLAVE_ENET_DEVFN);
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
} else { } else {
dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN); dev = pci_get_bus_and_slot(1, IXDP2400_MASTER_ENET_DEVFN);
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
ixdp2x00_slave_pci_postinit(); ixdp2x00_slave_pci_postinit();

View File

@ -262,14 +262,14 @@ int __init ixdp2800_pci_init(void)
pci_common_init(&ixdp2800_pci); pci_common_init(&ixdp2800_pci);
if (ixdp2x00_master_npu()) { if (ixdp2x00_master_npu()) {
dev = pci_get_bus_and_slot(1, IXDP2800_SLAVE_ENET_DEVFN); dev = pci_get_bus_and_slot(1, IXDP2800_SLAVE_ENET_DEVFN);
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
ixdp2800_master_enable_slave(); ixdp2800_master_enable_slave();
ixdp2800_master_wait_for_slave_bus_scan(); ixdp2800_master_wait_for_slave_bus_scan();
} else { } else {
dev = pci_get_bus_and_slot(1, IXDP2800_MASTER_ENET_DEVFN); dev = pci_get_bus_and_slot(1, IXDP2800_MASTER_ENET_DEVFN);
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
} }
} }

View File

@ -239,12 +239,12 @@ void ixdp2x00_slave_pci_postinit(void)
* Remove PMC device is there is one * Remove PMC device is there is one
*/ */
if((dev = pci_get_bus_and_slot(1, IXDP2X00_PMC_DEVFN))) { if((dev = pci_get_bus_and_slot(1, IXDP2X00_PMC_DEVFN))) {
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
} }
dev = pci_get_bus_and_slot(0, IXDP2X00_21555_DEVFN); dev = pci_get_bus_and_slot(0, IXDP2X00_21555_DEVFN);
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
} }

View File

@ -84,7 +84,7 @@ void pcibios_remove_pci_devices(struct pci_bus *bus)
list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
pr_debug(" * Removing %s...\n", pci_name(dev)); pr_debug(" * Removing %s...\n", pci_name(dev));
eeh_remove_bus_device(dev); eeh_remove_bus_device(dev);
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
} }
} }
EXPORT_SYMBOL_GPL(pcibios_remove_pci_devices); EXPORT_SYMBOL_GPL(pcibios_remove_pci_devices);

View File

@ -346,7 +346,7 @@ static int mpt_remove_dead_ioc_func(void *arg)
if ((pdev == NULL)) if ((pdev == NULL))
return -1; return -1;
pci_remove_bus_device(pdev); pci_stop_and_remove_bus_device(pdev);
return 0; return 0;
} }

View File

@ -910,7 +910,7 @@ static int disable_device(struct acpiphp_slot *slot)
disable_bridges(pdev->subordinate); disable_bridges(pdev->subordinate);
pci_disable_device(pdev); pci_disable_device(pdev);
} }
pci_remove_bus_device(pdev); pci_stop_and_remove_bus_device(pdev);
pci_dev_put(pdev); pci_dev_put(pdev);
} }
} }
@ -1067,7 +1067,7 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus)
res->end) { res->end) {
/* Could not assign a required resources /* Could not assign a required resources
* for this device, remove it */ * for this device, remove it */
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
break; break;
} }
} }

View File

@ -341,7 +341,7 @@ int cpci_unconfigure_slot(struct slot* slot)
dev = pci_get_slot(slot->bus, dev = pci_get_slot(slot->bus,
PCI_DEVFN(PCI_SLOT(slot->devfn), i)); PCI_DEVFN(PCI_SLOT(slot->devfn), i));
if (dev) { if (dev) {
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
} }
} }

View File

@ -127,7 +127,7 @@ int cpqhp_unconfigure_device(struct pci_func* func)
struct pci_dev* temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j)); struct pci_dev* temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j));
if (temp) { if (temp) {
pci_dev_put(temp); pci_dev_put(temp);
pci_remove_bus_device(temp); pci_stop_and_remove_bus_device(temp);
} }
} }
return 0; return 0;

View File

@ -40,7 +40,7 @@ static ssize_t legacy_show(struct kobject *kobj, struct attribute *attr,
static void remove_callback(void *data) static void remove_callback(void *data)
{ {
pci_remove_bus_device((struct pci_dev *)data); pci_stop_and_remove_bus_device((struct pci_dev *)data);
} }
static ssize_t legacy_store(struct kobject *kobj, struct attribute *attr, static ssize_t legacy_store(struct kobject *kobj, struct attribute *attr,

View File

@ -721,7 +721,7 @@ static void ibm_unconfigure_device(struct pci_func *func)
for (j = 0; j < 0x08; j++) { for (j = 0; j < 0x08; j++) {
temp = pci_get_bus_and_slot(func->busno, (func->device << 3) | j); temp = pci_get_bus_and_slot(func->busno, (func->device << 3) | j);
if (temp) { if (temp) {
pci_remove_bus_device(temp); pci_stop_and_remove_bus_device(temp);
pci_dev_put(temp); pci_dev_put(temp);
} }
} }

View File

@ -141,7 +141,7 @@ int pciehp_unconfigure_device(struct slot *p_slot)
break; break;
} }
} }
pci_remove_bus_device(temp); pci_stop_and_remove_bus_device(temp);
/* /*
* Ensure that no new Requests will be generated from * Ensure that no new Requests will be generated from
* the device. * the device.

View File

@ -389,7 +389,7 @@ int dlpar_remove_pci_slot(char *drc_name, struct device_node *dn)
BUG_ON(!bus->self); BUG_ON(!bus->self);
pr_debug("PCI: Now removing bridge device %s\n", pci_name(bus->self)); pr_debug("PCI: Now removing bridge device %s\n", pci_name(bus->self));
eeh_remove_bus_device(bus->self); eeh_remove_bus_device(bus->self);
pci_remove_bus_device(bus->self); pci_stop_and_remove_bus_device(bus->self);
return 0; return 0;
} }

View File

@ -554,7 +554,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
PCI_FUNC(func))); PCI_FUNC(func)));
if (dev) { if (dev) {
sn_bus_free_data(dev); sn_bus_free_data(dev);
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
} }
} }

View File

@ -124,7 +124,7 @@ int shpchp_unconfigure_device(struct slot *p_slot)
break; break;
} }
} }
pci_remove_bus_device(temp); pci_stop_and_remove_bus_device(temp);
pci_dev_put(temp); pci_dev_put(temp);
} }
return rc; return rc;

View File

@ -142,7 +142,7 @@ failed2:
failed1: failed1:
pci_dev_put(dev); pci_dev_put(dev);
mutex_lock(&iov->dev->sriov->lock); mutex_lock(&iov->dev->sriov->lock);
pci_remove_bus_device(virtfn); pci_stop_and_remove_bus_device(virtfn);
virtfn_remove_bus(dev->bus, virtfn_bus(dev, id)); virtfn_remove_bus(dev->bus, virtfn_bus(dev, id));
mutex_unlock(&iov->dev->sriov->lock); mutex_unlock(&iov->dev->sriov->lock);
@ -182,7 +182,7 @@ static void virtfn_remove(struct pci_dev *dev, int id, int reset)
sysfs_remove_link(&virtfn->dev.kobj, "physfn"); sysfs_remove_link(&virtfn->dev.kobj, "physfn");
mutex_lock(&iov->dev->sriov->lock); mutex_lock(&iov->dev->sriov->lock);
pci_remove_bus_device(virtfn); pci_stop_and_remove_bus_device(virtfn);
virtfn_remove_bus(dev->bus, virtfn_bus(dev, id)); virtfn_remove_bus(dev->bus, virtfn_bus(dev, id));
mutex_unlock(&iov->dev->sriov->lock); mutex_unlock(&iov->dev->sriov->lock);

View File

@ -330,7 +330,7 @@ static void remove_callback(struct device *dev)
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
mutex_lock(&pci_remove_rescan_mutex); mutex_lock(&pci_remove_rescan_mutex);
pci_remove_bus_device(pdev); pci_stop_and_remove_bus_device(pdev);
mutex_unlock(&pci_remove_rescan_mutex); mutex_unlock(&pci_remove_rescan_mutex);
} }

View File

@ -79,7 +79,7 @@ EXPORT_SYMBOL(pci_remove_bus);
static void __pci_remove_behind_bridge(struct pci_dev *dev); static void __pci_remove_behind_bridge(struct pci_dev *dev);
/** /**
* pci_remove_bus_device - remove a PCI device and any children * pci_stop_and_remove_bus_device - remove a PCI device and any children
* @dev: the device to remove * @dev: the device to remove
* *
* Remove a PCI device from the device lists, informing the drivers * Remove a PCI device from the device lists, informing the drivers
@ -102,7 +102,7 @@ static void __pci_remove_bus_device(struct pci_dev *dev)
pci_destroy_dev(dev); pci_destroy_dev(dev);
} }
void pci_remove_bus_device(struct pci_dev *dev) void pci_stop_and_remove_bus_device(struct pci_dev *dev)
{ {
pci_stop_bus_device(dev); pci_stop_bus_device(dev);
__pci_remove_bus_device(dev); __pci_remove_bus_device(dev);
@ -145,7 +145,7 @@ static void pci_stop_bus_devices(struct pci_bus *bus)
struct list_head *l, *n; struct list_head *l, *n;
/* /*
* VFs could be removed by pci_remove_bus_device() in the * VFs could be removed by pci_stop_and_remove_bus_device() in the
* pci_stop_bus_devices() code path for PF. * pci_stop_bus_devices() code path for PF.
* aka, bus->devices get updated in the process. * aka, bus->devices get updated in the process.
* but VFs are inserted after PFs when SRIOV is enabled for PF, * but VFs are inserted after PFs when SRIOV is enabled for PF,
@ -174,6 +174,6 @@ void pci_stop_bus_device(struct pci_dev *dev)
pci_stop_dev(dev); pci_stop_dev(dev);
} }
EXPORT_SYMBOL(pci_remove_bus_device); EXPORT_SYMBOL(pci_stop_and_remove_bus_device);
EXPORT_SYMBOL(pci_remove_behind_bridge); EXPORT_SYMBOL(pci_remove_behind_bridge);
EXPORT_SYMBOL_GPL(pci_stop_bus_device); EXPORT_SYMBOL_GPL(pci_stop_bus_device);

View File

@ -544,7 +544,7 @@ static void free_root_bus_devs(struct pci_bus *bus)
dev = container_of(bus->devices.next, struct pci_dev, dev = container_of(bus->devices.next, struct pci_dev,
bus_list); bus_list);
dev_dbg(&dev->dev, "removing device\n"); dev_dbg(&dev->dev, "removing device\n");
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
} }
} }
@ -1045,7 +1045,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
domain, bus, slot, func); domain, bus, slot, func);
continue; continue;
} }
pci_remove_bus_device(pci_dev); pci_stop_and_remove_bus_device(pci_dev);
pci_dev_put(pci_dev); pci_dev_put(pci_dev);
dev_dbg(&pdev->xdev->dev, dev_dbg(&pdev->xdev->dev,

View File

@ -571,7 +571,7 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
} else { } else {
dev = pci_get_slot(bus, 0); dev = pci_get_slot(bus, 0);
if (dev) { if (dev) {
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
} }
} }

View File

@ -646,7 +646,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
} else { } else {
dev = pci_get_slot(bus, 0); dev = pci_get_slot(bus, 0);
if (dev) { if (dev) {
pci_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev); pci_dev_put(dev);
} }
} }

View File

@ -132,7 +132,7 @@ static int mpt2sas_remove_dead_ioc_func(void *arg)
pdev = ioc->pdev; pdev = ioc->pdev;
if ((pdev == NULL)) if ((pdev == NULL))
return -1; return -1;
pci_remove_bus_device(pdev); pci_stop_and_remove_bus_device(pdev);
return 0; return 0;
} }

View File

@ -686,7 +686,7 @@ u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp);
extern struct pci_dev *pci_dev_get(struct pci_dev *dev); extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
extern void pci_dev_put(struct pci_dev *dev); extern void pci_dev_put(struct pci_dev *dev);
extern void pci_remove_bus(struct pci_bus *b); extern void pci_remove_bus(struct pci_bus *b);
extern void pci_remove_bus_device(struct pci_dev *dev); extern void pci_stop_and_remove_bus_device(struct pci_dev *dev);
extern void pci_stop_bus_device(struct pci_dev *dev); extern void pci_stop_bus_device(struct pci_dev *dev);
void pci_setup_cardbus(struct pci_bus *bus); void pci_setup_cardbus(struct pci_bus *bus);
extern void pci_sort_breadthfirst(void); extern void pci_sort_breadthfirst(void);