mtd: pxa2xx-flash: switch back from memremap to ioremap_cached
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 25 Feb 2016 07:57:52 +0000 (08:57 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 4 Apr 2016 08:26:40 +0000 (10:26 +0200)
This reverts commit 06968a54790d ("mtd: pxa2xx-flash: switch from
ioremap_cache to memremap"), since NOR with memory semantics in array mode
and RAM are not necessarily the same thing, and architectures may implement
ioremap_cached() and memremap() with different memory attributes.

For this reason, ioremap_cached() has been brought back from the dead on
the ARM side, so switch this driver back to using it instead of memremap().

Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
drivers/mtd/maps/pxa2xx-flash.c

index 7497090e990029fdf6b2161f4d2eb378abf2c540..2cde28ed95c99edd44fe324d5dac093271a04110 100644 (file)
@@ -71,8 +71,8 @@ static int pxa2xx_flash_probe(struct platform_device *pdev)
                       info->map.name);
                return -ENOMEM;
        }
-       info->map.cached = memremap(info->map.phys, info->map.size,
-                       MEMREMAP_WB);
+       info->map.cached =
+               ioremap_cached(info->map.phys, info->map.size);
        if (!info->map.cached)
                printk(KERN_WARNING "Failed to ioremap cached %s\n",
                       info->map.name);
@@ -111,7 +111,7 @@ static int pxa2xx_flash_remove(struct platform_device *dev)
        map_destroy(info->mtd);
        iounmap(info->map.virt);
        if (info->map.cached)
-               memunmap(info->map.cached);
+               iounmap(info->map.cached);
        kfree(info);
        return 0;
 }