mtd: rawnand: atmel: Add an __iomem cast on gen_pool_dma_alloc() call
authorBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 9 Jul 2018 20:09:23 +0000 (22:09 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 18 Jul 2018 08:10:16 +0000 (10:10 +0200)
gen_pool_dma_alloc() return type is void *, while internally, the
memory region exposed by the sram driver has been mapped with
ioremap().

Add a void * to void __iomem * cast to make sparse happy.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/atmel/nand-controller.c

index e8f7549..30dae4c 100644 (file)
@@ -2219,9 +2219,9 @@ atmel_hsmc_nand_controller_init(struct atmel_hsmc_nand_controller *nc)
                return -ENOMEM;
        }
 
-       nc->sram.virt = gen_pool_dma_alloc(nc->sram.pool,
-                                           ATMEL_NFC_SRAM_SIZE,
-                                           &nc->sram.dma);
+       nc->sram.virt = (void __iomem *)gen_pool_dma_alloc(nc->sram.pool,
+                                                          ATMEL_NFC_SRAM_SIZE,
+                                                          &nc->sram.dma);
        if (!nc->sram.virt) {
                dev_err(nc->base.dev,
                        "Could not allocate memory from the NFC SRAM pool\n");