diff options
Diffstat (limited to 'arch/mips/mm/ioremap.c')
-rw-r--r-- | arch/mips/mm/ioremap.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c index adf352273f63..9c44ca70befa 100644 --- a/arch/mips/mm/ioremap.c +++ b/arch/mips/mm/ioremap.c | |||
@@ -79,9 +79,14 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr, | |||
79 | BUG(); | 79 | BUG(); |
80 | spin_lock(&init_mm.page_table_lock); | 80 | spin_lock(&init_mm.page_table_lock); |
81 | do { | 81 | do { |
82 | pud_t *pud; | ||
82 | pmd_t *pmd; | 83 | pmd_t *pmd; |
83 | pmd = pmd_alloc(&init_mm, dir, address); | 84 | |
84 | error = -ENOMEM; | 85 | error = -ENOMEM; |
86 | pud = pud_alloc(&init_mm, dir, address); | ||
87 | if (!pud) | ||
88 | break; | ||
89 | pmd = pmd_alloc(&init_mm, pud, address); | ||
85 | if (!pmd) | 90 | if (!pmd) |
86 | break; | 91 | break; |
87 | if (remap_area_pmd(pmd, address, end - address, | 92 | if (remap_area_pmd(pmd, address, end - address, |
@@ -97,15 +102,6 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr, | |||
97 | } | 102 | } |
98 | 103 | ||
99 | /* | 104 | /* |
100 | * Allow physical addresses to be fixed up to help 36 bit peripherals. | ||
101 | */ | ||
102 | phys_t __attribute__ ((weak)) | ||
103 | fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
104 | { | ||
105 | return phys_addr; | ||
106 | } | ||
107 | |||
108 | /* | ||
109 | * Generic mapping function (not visible outside): | 105 | * Generic mapping function (not visible outside): |
110 | */ | 106 | */ |
111 | 107 | ||
@@ -121,7 +117,7 @@ fixup_bigphys_addr(phys_t phys_addr, phys_t size) | |||
121 | 117 | ||
122 | #define IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) | 118 | #define IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) |
123 | 119 | ||
124 | void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) | 120 | void __iomem * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) |
125 | { | 121 | { |
126 | struct vm_struct * area; | 122 | struct vm_struct * area; |
127 | unsigned long offset; | 123 | unsigned long offset; |
@@ -141,7 +137,7 @@ void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) | |||
141 | */ | 137 | */ |
142 | if (IS_LOW512(phys_addr) && IS_LOW512(last_addr) && | 138 | if (IS_LOW512(phys_addr) && IS_LOW512(last_addr) && |
143 | flags == _CACHE_UNCACHED) | 139 | flags == _CACHE_UNCACHED) |
144 | return (void *) KSEG1ADDR(phys_addr); | 140 | return (void __iomem *) CKSEG1ADDR(phys_addr); |
145 | 141 | ||
146 | /* | 142 | /* |
147 | * Don't allow anybody to remap normal RAM that we're using.. | 143 | * Don't allow anybody to remap normal RAM that we're using.. |
@@ -177,10 +173,10 @@ void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) | |||
177 | return NULL; | 173 | return NULL; |
178 | } | 174 | } |
179 | 175 | ||
180 | return (void *) (offset + (char *)addr); | 176 | return (void __iomem *) (offset + (char *)addr); |
181 | } | 177 | } |
182 | 178 | ||
183 | #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == KSEG1) | 179 | #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) |
184 | 180 | ||
185 | void __iounmap(volatile void __iomem *addr) | 181 | void __iounmap(volatile void __iomem *addr) |
186 | { | 182 | { |
@@ -190,10 +186,8 @@ void __iounmap(volatile void __iomem *addr) | |||
190 | return; | 186 | return; |
191 | 187 | ||
192 | p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); | 188 | p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); |
193 | if (!p) { | 189 | if (!p) |
194 | printk(KERN_ERR "iounmap: bad address %p\n", addr); | 190 | printk(KERN_ERR "iounmap: bad address %p\n", addr); |
195 | return; | ||
196 | } | ||
197 | 191 | ||
198 | kfree(p); | 192 | kfree(p); |
199 | } | 193 | } |