aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/io_trapped.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/io_trapped.c')
-rw-r--r--arch/sh/kernel/io_trapped.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index 32c385ef1011..0f62f4672754 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -58,7 +58,7 @@ int register_trapped_io(struct trapped_io *tiop)
58 58
59 for (k = 0; k < tiop->num_resources; k++) { 59 for (k = 0; k < tiop->num_resources; k++) {
60 res = tiop->resource + k; 60 res = tiop->resource + k;
61 len += roundup((res->end - res->start) + 1, PAGE_SIZE); 61 len += roundup(resource_size(res), PAGE_SIZE);
62 flags |= res->flags; 62 flags |= res->flags;
63 } 63 }
64 64
@@ -85,7 +85,7 @@ int register_trapped_io(struct trapped_io *tiop)
85 (unsigned long)(tiop->virt_base + len), 85 (unsigned long)(tiop->virt_base + len),
86 res->flags & IORESOURCE_IO ? "io" : "mmio", 86 res->flags & IORESOURCE_IO ? "io" : "mmio",
87 (unsigned long)res->start); 87 (unsigned long)res->start);
88 len += roundup((res->end - res->start) + 1, PAGE_SIZE); 88 len += roundup(resource_size(res), PAGE_SIZE);
89 } 89 }
90 90
91 tiop->magic = IO_TRAPPED_MAGIC; 91 tiop->magic = IO_TRAPPED_MAGIC;
@@ -128,7 +128,7 @@ void __iomem *match_trapped_io_handler(struct list_head *list,
128 return tiop->virt_base + voffs; 128 return tiop->virt_base + voffs;
129 } 129 }
130 130
131 len = (res->end - res->start) + 1; 131 len = resource_size(res);
132 voffs += roundup(len, PAGE_SIZE); 132 voffs += roundup(len, PAGE_SIZE);
133 } 133 }
134 } 134 }
@@ -173,7 +173,7 @@ static unsigned long lookup_address(struct trapped_io *tiop,
173 173
174 for (k = 0; k < tiop->num_resources; k++) { 174 for (k = 0; k < tiop->num_resources; k++) {
175 res = tiop->resource + k; 175 res = tiop->resource + k;
176 len = roundup((res->end - res->start) + 1, PAGE_SIZE); 176 len = roundup(resource_size(res), PAGE_SIZE);
177 if (address < (vaddr + len)) 177 if (address < (vaddr + len))
178 return res->start + (address - vaddr); 178 return res->start + (address - vaddr);
179 vaddr += len; 179 vaddr += len;