| .. | .. |
|---|
| 181 | 181 | return -ENOMEM; |
|---|
| 182 | 182 | |
|---|
| 183 | 183 | src = (void *)((unsigned long)src + (page << PAGE_SHIFT)); |
|---|
| 184 | | - /* |
|---|
| 185 | | - * Ensure that a highmem page is mapped with the correct |
|---|
| 186 | | - * pgprot. For non highmem the mapping is already there. |
|---|
| 187 | | - */ |
|---|
| 188 | | - dst = kmap_local_page_prot(d, prot); |
|---|
| 184 | + dst = kmap_atomic_prot(d, prot); |
|---|
| 185 | + if (!dst) |
|---|
| 186 | + return -ENOMEM; |
|---|
| 189 | 187 | |
|---|
| 190 | 188 | memcpy_fromio(dst, src, PAGE_SIZE); |
|---|
| 191 | 189 | |
|---|
| 192 | | - kunmap_local(dst); |
|---|
| 190 | + kunmap_atomic(dst); |
|---|
| 193 | 191 | |
|---|
| 194 | 192 | return 0; |
|---|
| 195 | 193 | } |
|---|
| .. | .. |
|---|
| 205 | 203 | return -ENOMEM; |
|---|
| 206 | 204 | |
|---|
| 207 | 205 | dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT)); |
|---|
| 208 | | - /* |
|---|
| 209 | | - * Ensure that a highmem page is mapped with the correct |
|---|
| 210 | | - * pgprot. For non highmem the mapping is already there. |
|---|
| 211 | | - */ |
|---|
| 212 | | - src = kmap_local_page_prot(s, prot); |
|---|
| 206 | + src = kmap_atomic_prot(s, prot); |
|---|
| 207 | + if (!src) |
|---|
| 208 | + return -ENOMEM; |
|---|
| 213 | 209 | |
|---|
| 214 | 210 | memcpy_toio(dst, src, PAGE_SIZE); |
|---|
| 215 | 211 | |
|---|
| 216 | | - kunmap_local(src); |
|---|
| 212 | + kunmap_atomic(src); |
|---|
| 217 | 213 | |
|---|
| 218 | 214 | return 0; |
|---|
| 219 | 215 | } |
|---|