2004-10-08 18:01:42

by Hanna Linder

[permalink] [raw]
Subject: [PATCH 2.6] pSeries_iommu.c replace pci_find_device with pci_get_device

As pci_find_device is going away I've replaced it with pci_get_device.
If someone with a PPC64 system could test it I would appreciate it.

Thanks.

Hanna Linder
IBM Linux Technology Center

Signed-off-by: Hanna Linder <[email protected]>

---
diff -Nrup linux-2.6.9-rc3-mm3cln/arch/ppc64/kernel/iSeries_pci.c linux-2.6.9-rc3-mm3patch/arch/ppc64/kernel/iSeries_pci.c
--- linux-2.6.9-rc3-mm3cln/arch/ppc64/kernel/iSeries_pci.c 2004-09-29 20:05:52.000000000 -0700
+++ linux-2.6.9-rc3-mm3patch/arch/ppc64/kernel/iSeries_pci.c 2004-10-08 10:20:56.576395832 -0700
@@ -216,8 +216,7 @@ void __init iSeries_pci_final_fixup(void
mf_displaySrc(0xC9000100);

printk("pcibios_final_fixup\n");
- while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))
- != NULL) {
+ for_each_pci_dev(pdev) {
node = find_Device_Node(pdev->bus->number, pdev->devfn);
printk("pci dev %p (%x.%x), node %p\n", pdev,
pdev->bus->number, pdev->devfn, node);


2004-10-08 18:16:29

by Hanna Linder

[permalink] [raw]
Subject: Re: [PATCH 2.6] pSeries_iommu.c replace pci_find_device with pci_get_device

--On Friday, October 08, 2004 10:40:19 AM -0700 Hanna Linder <[email protected]> wrote:

> As pci_find_device is going away I've replaced it with pci_get_device.
> If someone with a PPC64 system could test it I would appreciate it.
>
> Thanks.
>
> Hanna Linder
> IBM Linux Technology Center
>
> Signed-off-by: Hanna Linder <[email protected]>

Ooops. Included the wrong patch. Should be:

diff -Nrup linux-2.6.9-rc3-mm3cln/arch/ppc64/kernel/pSeries_iommu.c linux-2.6.9-rc3-mm3patch2/arch/ppc64/kernel/pSeries_iommu.c
--- linux-2.6.9-rc3-mm3cln/arch/ppc64/kernel/pSeries_iommu.c 2004-09-29 20:04:16.000000000 -0700
+++ linux-2.6.9-rc3-mm3patch2/arch/ppc64/kernel/pSeries_iommu.c 2004-10-08 10:22:35.448365008 -0700
@@ -427,7 +427,7 @@ void iommu_setup_pSeries(void)
* pci device_node. This means get_iommu_table() won't need to search
* up the device tree to find it.
*/
- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+ for_each_pci_dev(dev) {
mydn = dn = PCI_GET_DN(dev);

while (dn && dn->iommu_table == NULL)