HAS_IOMEM option may not be selected on some platforms (e.g, s390) and this will cause compilation failure due to missing memremap() implementation. Fix it by stubbing out swiotlb_mem_remap when CONFIG_HAS_IOMEM is not set.
Unified · Split
| @@ -163,6 +163,7 @@ static inline unsigned long nr_slots(u64 val) · 162 unmodified lines | ||
| 163 | 163 | * when swiotlb_unencrypted_base is set. (e.g. for Hyper-V AMD SEV-SNP |
| 164 | 164 | * Isolation VMs). |
| 165 | 165 | */ |
| 166 | +#ifdef CONFIG_HAS_IOMEM | |
| 166 | 167 | static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) |
| 167 | 168 | { |
| 168 | 169 | void *vaddr = NULL; |
| @@ -178,6 +179,12 @@ static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) · 9 unmodified lines | ||
| 178 | 179 | |
| 179 | 180 | return vaddr; |
| 180 | 181 | } |
| 182 | +#else | |
| 183 | +static void *swiotlb_mem_remap(struct io_tlb_mem *mem, unsigned long bytes) | |
| 184 | +{ | |
| 185 | + return NULL; | |
| 186 | +} | |
| 187 | +#endif | |
| 181 | 188 | |
| 182 | 189 | /* |
| 183 | 190 | * Early SWIOTLB allocation may be too early to allow an architecture to |