From patchwork Tue May 5 12:04:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Gala X-Patchwork-Id: 26874 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id A79E8B7069 for ; Tue, 5 May 2009 22:05:36 +1000 (EST) Received: by ozlabs.org (Postfix) id 2BA53DE17B; Tue, 5 May 2009 22:05:23 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 23AF0DE17A for ; Tue, 5 May 2009 22:05:23 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4AA71DDDF0 for ; Tue, 5 May 2009 22:05:09 +1000 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id n45C4tN7016130; Tue, 5 May 2009 07:04:55 -0500 From: Kumar Gala To: linuxppc-dev@ozlabs.org Subject: [PATCH] powerpc/pci: clean up direct access to sysdata by iseries platform Date: Tue, 5 May 2009 07:04:55 -0500 Message-Id: <1241525095-18041-1-git-send-email-galak@kernel.crashing.org> X-Mailer: git-send-email 1.6.0.6 Cc: Stephen Rothwell X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org 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 Tested-by: Stephen Rothwell Acked-by: Stephen Rothwell --- arch/powerpc/platforms/iseries/pci.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 02a634f..18343c3 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) { struct resource *bar_res = &dev->resource[bar_num]; long bar_size = pci_resource_len(dev, bar_num); + struct device_node *dn = pci_device_to_OF_node(dev); /* * 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) * Allocate the number of table entries needed for BAR. */ while (bar_size > 0 ) { - iomm_table[current_iomm_table_entry] = dev->sysdata; + iomm_table[current_iomm_table_entry] = dn; ds_addr_table[current_iomm_table_entry] = - iseries_ds_addr(dev->sysdata) | (bar_num << 24); + iseries_ds_addr(dn) | (bar_num << 24); bar_size -= IOMM_TABLE_ENTRY_SIZE; ++current_iomm_table_entry; } @@ -410,7 +411,7 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev) struct device_node *node; int i; - node = find_device_node(bus, pdev->devfn); + node = pci_device_to_OF_node(pdev); pr_debug("PCI: iSeries %s, pdev %p, node %p\n", pci_name(pdev), pdev, node); if (!node) { @@ -441,7 +442,6 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev) } } - pdev->sysdata = node; allocate_device_bars(pdev); iseries_device_information(pdev, bus, *sub_bus); iommu_devnode_init_iSeries(pdev, node);