Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bf79d8a authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/bjorn-cleanup-remove' into next

* pci/bjorn-cleanup-remove:
  PCI: Remove unused pci_dev_b()
  sgi-agp: Use list_for_each_entry() for bus->devices traversal
  parisc/PCI: Use list_for_each_entry() for bus->devices traversal
  parisc/PCI: Enable PERR/SERR on all devices
  frv/PCI: Use list_for_each_entry() for bus->devices traversal
  PCI: Leave normal LIST_POISON in deleted list entries
  PCI: Rename local variables to conventional names
  PCI: Remove unused, commented-out, code
  PCI: Stop and remove devices in one pass
  PCI: Fold stop and remove helpers into their callers
  PCI: Use list_for_each_entry() for bus->devices traversal
  PCI: Remove pci_stop_and_remove_behind_bridge()
  PCI: Don't export stop_bus_device and remove_bus_device interfaces
  pcmcia: Use common pci_stop_and_remove_bus_device()
  PCI: acpiphp: Use common pci_stop_and_remove_bus_device()
  PCI: acpiphp: Stop disabling bridges on remove
parents a28afda8 c29aabe2
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -330,10 +330,8 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
	pci_read_bridge_bases(bus);

	if (bus->number == 0) {
		struct list_head *ln;
		struct pci_dev *dev;
		for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) {
			dev = pci_dev_b(ln);
		list_for_each_entry(dev, &bus->devices, bus_list) {
			if (dev->devfn == 0) {
				dev->resource[0].start = 0;
				dev->resource[0].end = 0;
+2 −3
Original line number Diff line number Diff line
@@ -289,12 +289,11 @@ static int __devinit agp_sgi_init(void)

	j = 0;
	list_for_each_entry(info, &tioca_list, ca_list) {
		struct list_head *tmp;
		if (list_empty(info->ca_devices))
			continue;
		list_for_each(tmp, info->ca_devices) {
		list_for_each_entry(pdev, info->ca_devices, bus_list) {
			u8 cap_ptr;
			pdev = pci_dev_b(tmp);

			if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8))
				continue;
			cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
+3 −7
Original line number Diff line number Diff line
@@ -477,14 +477,12 @@ dino_card_setup(struct pci_bus *bus, void __iomem *base_addr)
	if (ccio_allocate_resource(dino_dev->hba.dev, res, _8MB,
				F_EXTEND(0xf0000000UL) | _8MB,
				F_EXTEND(0xffffffffUL) &~ _8MB, _8MB) < 0) {
		struct list_head *ln, *tmp_ln;
		struct pci_dev *dev, *tmp;

		printk(KERN_ERR "Dino: cannot attach bus %s\n",
		       dev_name(bus->bridge));
		/* kill the bus, we can't do anything with it */
		list_for_each_safe(ln, tmp_ln, &bus->devices) {
			struct pci_dev *dev = pci_dev_b(ln);

		list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
			list_del(&dev->bus_list);
		}
			
@@ -549,7 +547,6 @@ dino_card_fixup(struct pci_dev *dev)
static void __init
dino_fixup_bus(struct pci_bus *bus)
{
	struct list_head *ln;
        struct pci_dev *dev;
        struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->bridge));

@@ -596,8 +593,7 @@ dino_fixup_bus(struct pci_bus *bus)
	}


	list_for_each(ln, &bus->devices) {
		dev = pci_dev_b(ln);
	list_for_each_entry(dev, &bus->devices, bus_list) {
		if (is_card_dino(&dino_dev->hba.dev->id))
			dino_card_fixup(dev);

+3 −4
Original line number Diff line number Diff line
@@ -629,7 +629,7 @@ truncate_pat_collision(struct resource *root, struct resource *new)
static void
lba_fixup_bus(struct pci_bus *bus)
{
	struct list_head *ln;
	struct pci_dev *dev;
#ifdef FBB_SUPPORT
	u16 status;
#endif
@@ -710,9 +710,8 @@ lba_fixup_bus(struct pci_bus *bus)

	}

	list_for_each(ln, &bus->devices) {
	list_for_each_entry(dev, &bus->devices, bus_list) {
		int i;
		struct pci_dev *dev = pci_dev_b(ln);

		DBG("lba_fixup_bus() %s\n", pci_name(dev));

@@ -770,7 +769,7 @@ lba_fixup_bus(struct pci_bus *bus)
	}

	/* Lastly enable FBB/PERR/SERR on all devices too */
	list_for_each(ln, &bus->devices) {
	list_for_each_entry(dev, &bus->devices, bus_list) {
		(void) pci_read_config_word(dev, PCI_COMMAND, &status);
		status |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR | fbb_enable;
		(void) pci_write_config_word(dev, PCI_COMMAND, status);
+1 −45
Original line number Diff line number Diff line
@@ -869,17 +869,6 @@ static int __ref enable_device(struct acpiphp_slot *slot)
	return retval;
}

static void disable_bridges(struct pci_bus *bus)
{
	struct pci_dev *dev;
	list_for_each_entry(dev, &bus->devices, bus_list) {
		if (dev->subordinate) {
			disable_bridges(dev->subordinate);
			pci_disable_device(dev);
		}
	}
}

/* return first device in slot, acquiring a reference on it */
static struct pci_dev *dev_in_slot(struct acpiphp_slot *slot)
{
@@ -931,12 +920,7 @@ static int disable_device(struct acpiphp_slot *slot)
	 * here.
	 */
	while ((pdev = dev_in_slot(slot))) {
		pci_stop_bus_device(pdev);
		if (pdev->subordinate) {
			disable_bridges(pdev->subordinate);
			pci_disable_device(pdev);
		}
		__pci_remove_bus_device(pdev);
		pci_stop_and_remove_bus_device(pdev);
		pci_dev_put(pdev);
	}

@@ -1477,34 +1461,6 @@ int __init acpiphp_get_num_slots(void)
}


#if 0
/**
 * acpiphp_for_each_slot - call function for each slot
 * @fn: callback function
 * @data: context to be passed to callback function
 */
static int acpiphp_for_each_slot(acpiphp_callback fn, void *data)
{
	struct list_head *node;
	struct acpiphp_bridge *bridge;
	struct acpiphp_slot *slot;
	int retval = 0;

	list_for_each (node, &bridge_list) {
		bridge = (struct acpiphp_bridge *)node;
		for (slot = bridge->slots; slot; slot = slot->next) {
			retval = fn(slot, data);
			if (!retval)
				goto err_exit;
		}
	}

 err_exit:
	return retval;
}
#endif


/**
 * acpiphp_enable_slot - power on slot
 * @slot: ACPI PHP slot
Loading