linux-mips
[Top] [All Lists]

[PATCH] MIPS: pci: fix build errors in pci_load_of_ranges

To: Olof Johansson <olof@lixom.net>
Subject: [PATCH] MIPS: pci: fix build errors in pci_load_of_ranges
From: Gabor Juhos <juhosg@openwrt.org>
Date: Fri, 19 Apr 2013 09:39:12 +0200
Cc: Andrew Murray <Andrew.Murray@arm.com>, Jason Cooper <jason@lakedaemon.net>, Gabor Juhos <juhosg@openwrt.org>, Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
The 'pci_load_of_ranges' function has been converted to use
the common 'of_pci_range_parser' helper by the following commit:
"of/pci: mips: convert to common of_pci_range_parser".

That change causes build error because the type of the 'range'
variable is defined as 'struct pci_of_range_range' instead of
the corect 'struct pci_of_range':

  arch/mips/pci/pci.c: In function 'pci_load_of_ranges':
  arch/mips/pci/pci.c:124:28: error: storage size of 'range' isn't known

Furthermore, the code uses non-existent fields:

  arch/mips/pci/pci.c: In function 'pci_load_of_ranges':
  arch/mips/pci/pci.c:139:4: error: 'struct of_pci_range' has no member named 
'addr'
  arch/mips/pci/pci.c:139:4: error: 'struct of_pci_range' has no member named 
'addr'
  arch/mips/pci/pci.c:142:20: error: 'struct of_pci_range' has no member named 
'addr'
  arch/mips/pci/pci.c:145:4: error: 'struct of_pci_range' has no member named 
'addr'
  arch/mips/pci/pci.c:145:4: error: 'struct of_pci_range' has no member named 
'addr'

Use the correct structure and field names to fix the errors.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
Note:

Although this is a MIPS specific patch, it should be merged via
the arm-soc tree, because the offending commit exist only in that.

The patch is based on the next/drivers branch of the arm-soc tree.
---
 arch/mips/pci/pci.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index bee49a4..9c15061 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -122,7 +122,7 @@ static void pcibios_scanbus(struct pci_controller *hose)
 #ifdef CONFIG_OF
 void pci_load_of_ranges(struct pci_controller *hose, struct device_node *node)
 {
-       struct of_pci_range_range range;
+       struct of_pci_range range;
        struct of_pci_range_parser parser;
        u32 res_type;
 
@@ -138,13 +138,16 @@ void pci_load_of_ranges(struct pci_controller *hose, 
struct device_node *node)
                res_type = range.flags & IORESOURCE_TYPE_BITS;
                if (res_type == IORESOURCE_IO) {
                        pr_info("  IO 0x%016llx..0x%016llx\n",
-                               range.addr, range.addr + range.size - 1);
+                               range.cpu_addr,
+                               range.cpu_addr + range.size - 1);
                        hose->io_map_base =
-                               (unsigned long)ioremap(range.addr, range.size);
+                               (unsigned long)ioremap(range.cpu_addr,
+                                                      range.size);
                        res = hose->io_resource;
                } else if (res_type == IORESOURCE_MEM) {
                        pr_info(" MEM 0x%016llx..0x%016llx\n",
-                               range.addr, range.addr + range.size - 1);
+                               range.cpu_addr,
+                               range.cpu_addr + range.size - 1);
                        res = hose->mem_resource;
                }
                if (res != NULL)
-- 
1.7.10


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: pci: fix build errors in pci_load_of_ranges, Gabor Juhos <=