lantiq: Fix flash for targets with NO_XIP
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.14 / 0160-owrt-lantiq-multiple-flash.patch
index 87e6cbb89ad798d2c33c4414e86ae1eba7029655..184824716d156f886d6103c9bbaaafdc6d002913 100644 (file)
@@ -1,5 +1,5 @@
---- "a/drivers/mtd/maps/lantiq-flash.c"
-+++ "b/drivers/mtd/maps/lantiq-flash.c"
+--- a/drivers/mtd/maps/lantiq-flash.c
++++ b/drivers/mtd/maps/lantiq-flash.c
 @@ -20,6 +20,7 @@
  #include <linux/mtd/cfi.h>
  #include <linux/platform_device.h>
@@ -8,7 +8,7 @@
  #include <linux/of.h>
  
  #include <lantiq_soc.h>
-@@ -39,10 +40,12 @@
+@@ -39,10 +40,12 @@ enum {
        LTQ_NOR_NORMAL
  };
  
@@ -24,7 +24,7 @@
  };
  
  static const char ltq_map_name[] = "ltq_nor";
-@@ -110,12 +113,39 @@
+@@ -110,12 +113,39 @@ ltq_copy_to(struct map_info *map, unsign
  }
  
  static int
@@ -65,7 +65,7 @@
  
        static const char *rom_probe_types[] = {
                "cfi_probe", "jedec_probe", NULL
-@@ -134,79 +164,88 @@
+@@ -134,79 +164,88 @@ ltq_mtd_probe(struct platform_device *pd
  
        platform_set_drvdata(pdev, ltq_mtd);
  
@@ -98,7 +98,7 @@
 +              else
 +                      ltq_mtd->map[i].phys = pdev->resource[i].start;
 +              ltq_mtd->map[i].size = resource_size(&pdev->resource[i]);
-+              ltq_mtd->map[i].virt = devm_ioremap(&pdev->dev, ltq_mtd->map[i].phys,
++              ltq_mtd->map[i].virt = devm_ioremap(&pdev->dev, pdev->resource[i].start,
 +                                               ltq_mtd->map[i].size);
 +              if (IS_ERR(ltq_mtd->map[i].virt))
 +                      return PTR_ERR(ltq_mtd->map[i].virt);