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

Commit 6354647f authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/list-for-each-entry' into next

* pci/list-for-each-entry:
  PCI: Remove pci_bus_b() and use list_for_each_entry() directly
  pcmcia: Use list_for_each_entry() for bus traversal
  powerpc/PCI: Use list_for_each_entry() for bus traversal
  drm: Use list_for_each_entry() for bus traversal
  ARM/PCI: Use list_for_each_entry() for bus traversal
  ACPI / hotplug / PCI: Use list_for_each_entry() for bus traversal
parents c128856b 94e6a9b9
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -57,14 +57,11 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in


void pcibios_report_status(u_int status_mask, int warn)
void pcibios_report_status(u_int status_mask, int warn)
{
{
	struct list_head *l;
	struct pci_bus *bus;

	list_for_each(l, &pci_root_buses) {
		struct pci_bus *bus = pci_bus_b(l);


	list_for_each_entry(bus, &pci_root_buses, node)
		pcibios_bus_report_status(bus, status_mask, warn);
		pcibios_bus_report_status(bus, status_mask, warn);
}
}
}


/*
/*
 * We don't use this to fix the device, but initialisation of it.
 * We don't use this to fix the device, but initialisation of it.
+1 −3
Original line number Original line Diff line number Diff line
@@ -208,7 +208,6 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
			  unsigned long in_devfn)
			  unsigned long in_devfn)
{
{
	struct pci_controller* hose;
	struct pci_controller* hose;
	struct list_head *ln;
	struct pci_bus *bus = NULL;
	struct pci_bus *bus = NULL;
	struct device_node *hose_node;
	struct device_node *hose_node;


@@ -230,8 +229,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
	 * used on pre-domains setup. We return the first match
	 * used on pre-domains setup. We return the first match
	 */
	 */


	for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
	list_for_each_entry(bus, &pci_root_buses, node) {
		bus = pci_bus_b(ln);
		if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
		if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
			break;
			break;
		bus = NULL;
		bus = NULL;
+3 −3
Original line number Original line Diff line number Diff line
@@ -37,15 +37,15 @@ find_bus_among_children(struct pci_bus *bus,
                        struct device_node *dn)
                        struct device_node *dn)
{
{
	struct pci_bus *child = NULL;
	struct pci_bus *child = NULL;
	struct list_head *tmp;
	struct pci_bus *tmp;
	struct device_node *busdn;
	struct device_node *busdn;


	busdn = pci_bus_to_OF_node(bus);
	busdn = pci_bus_to_OF_node(bus);
	if (busdn == dn)
	if (busdn == dn)
		return bus;
		return bus;


	list_for_each(tmp, &bus->children) {
	list_for_each_entry(tmp, &bus->children, node) {
		child = find_bus_among_children(pci_bus_b(tmp), dn);
		child = find_bus_among_children(tmp, dn);
		if (child)
		if (child)
			break;
			break;
	};
	};
+2 −1
Original line number Original line Diff line number Diff line
@@ -319,7 +319,8 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
			pci_dev_put(pci_dev);
			pci_dev_put(pci_dev);
		}
		}
		if (!dev->hose) {
		if (!dev->hose) {
			struct pci_bus *b = pci_bus_b(pci_root_buses.next);
			struct pci_bus *b = list_entry(pci_root_buses.next,
				struct pci_bus, node);
			if (b)
			if (b)
				dev->hose = b->sysdata;
				dev->hose = b->sysdata;
		}
		}
+3 −3
Original line number Original line Diff line number Diff line
@@ -450,7 +450,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
 */
 */
static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
{
{
	struct list_head *tmp;
	struct pci_bus *tmp;
	unsigned char max, n;
	unsigned char max, n;


	/*
	/*
@@ -463,8 +463,8 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
	 */
	 */
	max = bus->busn_res.start;
	max = bus->busn_res.start;


	list_for_each(tmp, &bus->children) {
	list_for_each_entry(tmp, &bus->children, node) {
		n = pci_bus_max_busnr(pci_bus_b(tmp));
		n = pci_bus_max_busnr(tmp);
		if (n > max)
		if (n > max)
			max = n;
			max = n;
	}
	}
Loading