diff options
Diffstat (limited to 'arch/sparc/kernel/ioport.c')
-rw-r--r-- | arch/sparc/kernel/ioport.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 1c9c80a1a86a..6ffccd6e0156 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -228,7 +228,7 @@ _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | pa &= PAGE_MASK; | 230 | pa &= PAGE_MASK; |
231 | sparc_mapiorange(bus, pa, res->start, res->end - res->start + 1); | 231 | sparc_mapiorange(bus, pa, res->start, resource_size(res)); |
232 | 232 | ||
233 | return (void __iomem *)(unsigned long)(res->start + offset); | 233 | return (void __iomem *)(unsigned long)(res->start + offset); |
234 | } | 234 | } |
@@ -240,7 +240,7 @@ static void _sparc_free_io(struct resource *res) | |||
240 | { | 240 | { |
241 | unsigned long plen; | 241 | unsigned long plen; |
242 | 242 | ||
243 | plen = res->end - res->start + 1; | 243 | plen = resource_size(res); |
244 | BUG_ON((plen & (PAGE_SIZE-1)) != 0); | 244 | BUG_ON((plen & (PAGE_SIZE-1)) != 0); |
245 | sparc_unmapiorange(res->start, plen); | 245 | sparc_unmapiorange(res->start, plen); |
246 | release_resource(res); | 246 | release_resource(res); |
@@ -331,9 +331,9 @@ static void sbus_free_coherent(struct device *dev, size_t n, void *p, | |||
331 | } | 331 | } |
332 | 332 | ||
333 | n = PAGE_ALIGN(n); | 333 | n = PAGE_ALIGN(n); |
334 | if ((res->end-res->start)+1 != n) { | 334 | if (resource_size(res) != n) { |
335 | printk("sbus_free_consistent: region 0x%lx asked 0x%zx\n", | 335 | printk("sbus_free_consistent: region 0x%lx asked 0x%zx\n", |
336 | (long)((res->end-res->start)+1), n); | 336 | (long)resource_size(res), n); |
337 | return; | 337 | return; |
338 | } | 338 | } |
339 | 339 | ||
@@ -504,9 +504,9 @@ static void pci32_free_coherent(struct device *dev, size_t n, void *p, | |||
504 | } | 504 | } |
505 | 505 | ||
506 | n = PAGE_ALIGN(n); | 506 | n = PAGE_ALIGN(n); |
507 | if ((res->end-res->start)+1 != n) { | 507 | if (resource_size(res) != n) { |
508 | printk("pci_free_consistent: region 0x%lx asked 0x%lx\n", | 508 | printk("pci_free_consistent: region 0x%lx asked 0x%lx\n", |
509 | (long)((res->end-res->start)+1), (long)n); | 509 | (long)resource_size(res), (long)n); |
510 | return; | 510 | return; |
511 | } | 511 | } |
512 | 512 | ||