diff options
Diffstat (limited to 'arch/powerpc/sysdev/fsl_pci.c')
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 68ca9290df94..ba5cb3fa7074 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -64,7 +64,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, | |||
64 | { | 64 | { |
65 | resource_size_t pci_addr = res->start - offset; | 65 | resource_size_t pci_addr = res->start - offset; |
66 | resource_size_t phys_addr = res->start; | 66 | resource_size_t phys_addr = res->start; |
67 | resource_size_t size = res->end - res->start + 1; | 67 | resource_size_t size = resource_size(res); |
68 | u32 flags = 0x80044000; /* enable & mem R/W */ | 68 | u32 flags = 0x80044000; /* enable & mem R/W */ |
69 | unsigned int i; | 69 | unsigned int i; |
70 | 70 | ||
@@ -108,7 +108,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
108 | char *name = hose->dn->full_name; | 108 | char *name = hose->dn->full_name; |
109 | 109 | ||
110 | pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", | 110 | pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", |
111 | (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); | 111 | (u64)rsrc->start, (u64)resource_size(rsrc)); |
112 | 112 | ||
113 | if (of_device_is_compatible(hose->dn, "fsl,qoriq-pcie-v2.2")) { | 113 | if (of_device_is_compatible(hose->dn, "fsl,qoriq-pcie-v2.2")) { |
114 | win_idx = 2; | 114 | win_idx = 2; |
@@ -116,7 +116,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
116 | end_idx = 3; | 116 | end_idx = 3; |
117 | } | 117 | } |
118 | 118 | ||
119 | pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1); | 119 | pci = ioremap(rsrc->start, resource_size(rsrc)); |
120 | if (!pci) { | 120 | if (!pci) { |
121 | dev_err(hose->parent, "Unable to map ATMU registers\n"); | 121 | dev_err(hose->parent, "Unable to map ATMU registers\n"); |
122 | return; | 122 | return; |
@@ -153,9 +153,9 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
153 | } else { | 153 | } else { |
154 | pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, " | 154 | pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, " |
155 | "phy base 0x%016llx.\n", | 155 | "phy base 0x%016llx.\n", |
156 | (u64)hose->io_resource.start, | 156 | (u64)hose->io_resource.start, |
157 | (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1, | 157 | (u64)resource_size(&hose->io_resource), |
158 | (u64)hose->io_base_phys); | 158 | (u64)hose->io_base_phys); |
159 | out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12)); | 159 | out_be32(&pci->pow[j].potar, (hose->io_resource.start >> 12)); |
160 | out_be32(&pci->pow[j].potear, 0); | 160 | out_be32(&pci->pow[j].potear, 0); |
161 | out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12)); | 161 | out_be32(&pci->pow[j].powbar, (hose->io_base_phys >> 12)); |