diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/mm/ioremap_fixed.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/sh/mm/ioremap_fixed.c b/arch/sh/mm/ioremap_fixed.c index 551b513e8fce..0b78b1e20ef1 100644 --- a/arch/sh/mm/ioremap_fixed.c +++ b/arch/sh/mm/ioremap_fixed.c | |||
@@ -93,9 +93,7 @@ ioremap_fixed(resource_size_t phys_addr, unsigned long offset, | |||
93 | int iounmap_fixed(void __iomem *addr) | 93 | int iounmap_fixed(void __iomem *addr) |
94 | { | 94 | { |
95 | enum fixed_addresses idx; | 95 | enum fixed_addresses idx; |
96 | unsigned long virt_addr; | ||
97 | struct ioremap_map *map; | 96 | struct ioremap_map *map; |
98 | unsigned long offset; | ||
99 | unsigned int nrpages; | 97 | unsigned int nrpages; |
100 | int i, slot; | 98 | int i, slot; |
101 | 99 | ||
@@ -114,12 +112,9 @@ int iounmap_fixed(void __iomem *addr) | |||
114 | if (slot < 0) | 112 | if (slot < 0) |
115 | return -EINVAL; | 113 | return -EINVAL; |
116 | 114 | ||
117 | virt_addr = (unsigned long)addr; | 115 | nrpages = map->size >> PAGE_SHIFT; |
118 | 116 | ||
119 | offset = virt_addr & ~PAGE_MASK; | 117 | idx = FIX_IOREMAP_BEGIN + slot + nrpages - 1; |
120 | nrpages = PAGE_ALIGN(offset + map->size - 1) >> PAGE_SHIFT; | ||
121 | |||
122 | idx = FIX_IOREMAP_BEGIN + slot + nrpages; | ||
123 | while (nrpages > 0) { | 118 | while (nrpages > 0) { |
124 | __clear_fixmap(idx, __pgprot(_PAGE_WIRED)); | 119 | __clear_fixmap(idx, __pgprot(_PAGE_WIRED)); |
125 | --idx; | 120 | --idx; |