Skip to contentSkip to conversation

Replace pci_find_device with pci_get_device

PATCH In review [email protected] 4 participants 7 messages Jan 10, 2005 – Jan 11, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 Replace pci_find_device with pci_get_device

As pci_find_device is going away soon I have replaced the call with pci_get_device. Judith, could you run these 3 ia64 ones through PLM, please?

Thanks a lot.

Hanna Linder
IBM Linux Technology Center

---

---

 kj-domen/arch/ia64/pci/pci.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
arch/ia64/pci/pci.c renamed from arch/ia64/pci/pci.c~pci_dev_present-arch_ia64_pci_pci +1 -1
diff -puN arch/ia64/pci/pci.c~pci_dev_present-arch_ia64_pci_pci arch/ia64/pci/pci.c
@@ -154,7 +154,7 @@ extern acpi_status acpi_map_iosapic (acp
 		printk(KERN_INFO "** was specified.  If this was required to make a driver work,\n");
 		printk(KERN_INFO "** please email the output of \"lspci\" to [email protected]\n");
 		printk(KERN_INFO "** so I can fix the driver.\n");
-		while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+		while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
 			acpi_pci_irq_enable(dev);
 	} else {
 		printk(KERN_INFO "** PCI interrupts are no longer routed automatically.  If this\n");

_

#1 lore raw

arch/ia64/pci/pci.c extern acpi_status acpi_map_iosapic (acp · line 158

Quoted 3 lines · On Monday, January 10, 2005 11:46 am, [email protected] wrote:
arch/ia64/pci/pci.c renamed from arch/ia64/pci/pci.c~pci_dev_present-arch_ia64_pci_pci +1 -1
-  while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+  while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
    acpi_pci_irq_enable(dev);

Shouldn't this be for_each_pci_dev(dev) acpi_pci_irq_enable(dev); instead? Bjorn?

Thanks,
Jesse

#2 lore raw
In reply to [email protected]
Quoted 10 lines · --On Monday, January 10, 2005 01:09:30 PM -0800 Jesse Barnes…

arch/ia64/pci/pci.c extern acpi_status acpi_map_iosapic (acp · line 158

Quoted 3 lines · On Monday, January 10, 2005 11:46 am, [email protected] wrote:
arch/ia64/pci/pci.c renamed from arch/ia64/pci/pci.c~pci_dev_present-arch_ia64_pci_pci +1 -1
-  while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+  while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
    acpi_pci_irq_enable(dev);

Shouldn't this be for_each_pci_dev(dev) acpi_pci_irq_enable(dev); instead? Bjorn?

Thanks,
Jesse

Looks to me like it should be as well. I must have missed it when I went through and did for_each_pci_dev. I can try to make a new patch but it might take a day or two.

Hanna

#3 lore raw
In reply to [email protected]
Quoted 7 lines · Jesse Barnes

arch/ia64/pci/pci.c extern acpi_status acpi_map_iosapic (acp · line 158

Quoted 3 lines · On Monday, January 10, 2005 11:46 am, [email protected] wrote:
arch/ia64/pci/pci.c renamed from arch/ia64/pci/pci.c~pci_dev_present-arch_ia64_pci_pci +1 -1
-  while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+  while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
    acpi_pci_irq_enable(dev);

Shouldn't this be for_each_pci_dev(dev) acpi_pci_irq_enable(dev); instead? Bjorn?

They're equivalent, right? Looks OK to me either way. I guess if you switch to for_each_pci_dev(), you could switch the one in sba_iommu.c, too.

#4 lore raw
In reply to [email protected]
Quoted 6 lines · --On Monday, January 10, 2005 02:21:56 PM -0700 Bjorn Helgaas…
Quoted 2 lines

Shouldn't this be for_each_pci_dev(dev) acpi_pci_irq_enable(dev); instead? Bjorn?

They're equivalent, right? Looks OK to me either way. I guess if you switch to for_each_pci_dev(), you could switch the one in sba_iommu.c, too.

Yes they are equivalent. Will do.

Hanna

#5 lore raw

Re: [patch 2/3] Replace pci_find_device with pci_get_device - pci.c

In reply to [email protected]
Quoted 6 lines · --On Monday, January 10, 2005 02:21:56 PM -0700 Bjorn Helgaas…
Quoted 5 lines · Jesse Barnes
Quoted 3 lines · On Monday, January 10, 2005 11:46 am, [email protected] wrote:
(quoted diff) +1 -1
-  while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+  while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
    acpi_pci_irq_enable(dev);
Quoted 6 lines
Quoted 2 lines

Shouldn't this be for_each_pci_dev(dev) acpi_pci_irq_enable(dev); instead? Bjorn?

They're equivalent, right? Looks OK to me either way. I guess if you switch to for_each_pci_dev(), you could switch the one in sba_iommu.c, too.

Ok. Here is the reroll of the original patch to us for_each_pci_dev:

arch/ia64/pci/pci.c +1 -1
diff -Nrup linux-2.6.10cln/arch/ia64/pci/pci.c linux-2.6.10p/arch/ia64/pci/pci.c
@@ -154,7 +154,7 @@ extern acpi_status acpi_map_iosapic (acp
 		printk(KERN_INFO "** was specified.  If this was required to make a driver work,\n");
 		printk(KERN_INFO "** please email the output of \"lspci\" to [email protected]\n");
 		printk(KERN_INFO "** so I can fix the driver.\n");
-		while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+		for_each_pci_dev(dev)
 			acpi_pci_irq_enable(dev);
 	} else {
 		printk(KERN_INFO "** PCI interrupts are no longer routed automatically.  If this\n");
#6 lore raw

Re: [patch 2/3] Replace pci_find_device with pci_get_device - sba_iommu.c

In reply to [email protected]
Quoted 6 lines · --On Monday, January 10, 2005 02:21:56 PM -0700 Bjorn Helgaas…
Quoted 5 lines · Jesse Barnes
Quoted 3 lines · On Monday, January 10, 2005 11:46 am, [email protected] wrote:
(quoted diff) +1 -1
-  while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+  while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
    acpi_pci_irq_enable(dev);
Quoted 6 lines
Quoted 2 lines

Shouldn't this be for_each_pci_dev(dev) acpi_pci_irq_enable(dev); instead? Bjorn?

They're equivalent, right? Looks OK to me either way. I guess if you switch to for_each_pci_dev(), you could switch the one in sba_iommu.c, too.

Here is the reroll of the sba_iommu.c patch to use for_each_pci_dev.

arch/ia64/hp/common/sba_iommu.c +1 -1
diff -Nrup linux-2.6.10cln/arch/ia64/hp/common/sba_iommu.c linux-2.6.10p2/arch/ia64/hp/common/sba_iommu.c
@@ -1557,7 +1557,7 @@ ioc_iova_init(struct ioc *ioc)
 	** We program the next pdir index after we stop w/ a key for
 	** the GART code to handshake on.
 	*/
-	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL)
+	for_each_pci_dev(device)	
 		agp_found |= pci_find_capability(device, PCI_CAP_ID_AGP);
 
 	if (agp_found && reserve_sba_gart) {