diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2009-05-17 22:56:27 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-05-21 01:44:26 -0400 |
commit | d7b41b1fdf162d3e26cb73bf2cf14816918e371e (patch) | |
tree | c20b64c299502473653f5f6d1f33537d87c75678 | |
parent | 80947e7c99c29ce3a78bdc1933b310468455a82f (diff) |
powerpc/pci: clean up direct access to sysdata by iseries platform
We shouldn't directly access sysdata to get the device node. We should
be calling pci_device_to_OF_node().
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/iseries/iommu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/pci.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c index 40219823d9b0..6c1e1011959e 100644 --- a/arch/powerpc/platforms/iseries/iommu.c +++ b/arch/powerpc/platforms/iseries/iommu.c | |||
@@ -177,7 +177,7 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl) | |||
177 | static void pci_dma_dev_setup_iseries(struct pci_dev *pdev) | 177 | static void pci_dma_dev_setup_iseries(struct pci_dev *pdev) |
178 | { | 178 | { |
179 | struct iommu_table *tbl; | 179 | struct iommu_table *tbl; |
180 | struct device_node *dn = pdev->sysdata; | 180 | struct device_node *dn = pci_device_to_OF_node(pdev); |
181 | struct pci_dn *pdn = PCI_DN(dn); | 181 | struct pci_dn *pdn = PCI_DN(dn); |
182 | const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL); | 182 | const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL); |
183 | 183 | ||
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 21cddc30220b..175aac8ca7e5 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -318,6 +318,7 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) | |||
318 | { | 318 | { |
319 | struct resource *bar_res = &dev->resource[bar_num]; | 319 | struct resource *bar_res = &dev->resource[bar_num]; |
320 | long bar_size = pci_resource_len(dev, bar_num); | 320 | long bar_size = pci_resource_len(dev, bar_num); |
321 | struct device_node *dn = pci_device_to_OF_node(dev); | ||
321 | 322 | ||
322 | /* | 323 | /* |
323 | * No space to allocate, quick exit, skip Allocation. | 324 | * No space to allocate, quick exit, skip Allocation. |
@@ -335,9 +336,9 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num) | |||
335 | * Allocate the number of table entries needed for BAR. | 336 | * Allocate the number of table entries needed for BAR. |
336 | */ | 337 | */ |
337 | while (bar_size > 0 ) { | 338 | while (bar_size > 0 ) { |
338 | iomm_table[current_iomm_table_entry] = dev->sysdata; | 339 | iomm_table[current_iomm_table_entry] = dn; |
339 | ds_addr_table[current_iomm_table_entry] = | 340 | ds_addr_table[current_iomm_table_entry] = |
340 | iseries_ds_addr(dev->sysdata) | (bar_num << 24); | 341 | iseries_ds_addr(dn) | (bar_num << 24); |
341 | bar_size -= IOMM_TABLE_ENTRY_SIZE; | 342 | bar_size -= IOMM_TABLE_ENTRY_SIZE; |
342 | ++current_iomm_table_entry; | 343 | ++current_iomm_table_entry; |
343 | } | 344 | } |
@@ -410,7 +411,7 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev) | |||
410 | struct device_node *node; | 411 | struct device_node *node; |
411 | int i; | 412 | int i; |
412 | 413 | ||
413 | node = find_device_node(bus, pdev->devfn); | 414 | node = pci_device_to_OF_node(pdev); |
414 | pr_debug("PCI: iSeries %s, pdev %p, node %p\n", | 415 | pr_debug("PCI: iSeries %s, pdev %p, node %p\n", |
415 | pci_name(pdev), pdev, node); | 416 | pci_name(pdev), pdev, node); |
416 | if (!node) { | 417 | if (!node) { |
@@ -441,7 +442,6 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev) | |||
441 | } | 442 | } |
442 | } | 443 | } |
443 | 444 | ||
444 | pdev->sysdata = node; | ||
445 | allocate_device_bars(pdev); | 445 | allocate_device_bars(pdev); |
446 | iseries_device_information(pdev, bus, *sub_bus); | 446 | iseries_device_information(pdev, bus, *sub_bus); |
447 | } | 447 | } |