summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-02-05 13:53:57 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-02-11 10:37:49 +0100
commitee2aaa8bf348cbe4dd4ffbe2c223ee9acf497eaf (patch)
tree8d1f569cdf5e1a1e1f808e2583c9fe2492b50f5c /drivers/pci
parent55765b9c1f78e07586624d66d4d4124354d390c7 (diff)
downloadbarebox-ee2aaa8bf348cbe4dd4ffbe2c223ee9acf497eaf.tar.gz
barebox-ee2aaa8bf348cbe4dd4ffbe2c223ee9acf497eaf.tar.xz
PCI: dwc: Fix pointer width cast problem
Casting to u32 works well on 32-bit builds, but causes problem when compiled on 64-bit machines. Switch it to cast to "unsigned long", so that it would have appropriate width in both cases. While at it, replace explicit casts to void * with IOMEM. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pcie-designware-host.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/pcie-designware-host.c b/drivers/pci/pcie-designware-host.c
index 6cc4b93a31..dc38cdc8f6 100644
--- a/drivers/pci/pcie-designware-host.c
+++ b/drivers/pci/pcie-designware-host.c
@@ -150,15 +150,15 @@ int __init dw_pcie_host_init(struct pcie_port *pp)
}
if (!pci->dbi_base)
- pci->dbi_base = (void __force *)pp->cfg.start;
+ pci->dbi_base = IOMEM(pp->cfg.start);
pp->mem_base = pp->mem.start;
if (!pp->va_cfg0_base)
- pp->va_cfg0_base = (void __force *)(u32)pp->cfg0_base;
+ pp->va_cfg0_base = IOMEM((unsigned long)pp->cfg0_base);
if (!pp->va_cfg1_base)
- pp->va_cfg1_base = (void __force *)(u32)pp->cfg1_base;
+ pp->va_cfg1_base = IOMEM((unsigned long)pp->cfg1_base);
ret = of_property_read_u32(np, "num-viewport", &pci->num_viewport);
if (ret)