lantiq: Fix flash for targets with NO_XIP
authorJohn Crispin <john@openwrt.org>
Sat, 14 Feb 2015 20:48:26 +0000 (20:48 +0000)
committerJohn Crispin <john@openwrt.org>
Sat, 14 Feb 2015 20:48:26 +0000 (20:48 +0000)
For targets with NO_XIP ltq_mtd->map[i].phys equals -1 and devm_ioremap fails.
Fix this by using pdev->resource[i].start instead.

Signed-off-by: Matti Laakso <malaakso@elisanet.fi>
SVN-Revision: 44450

target/linux/lantiq/patches-3.14/0160-owrt-lantiq-multiple-flash.patch
target/linux/lantiq/patches-3.18/0160-owrt-lantiq-multiple-flash.patch

index ac644abb51d0fda89211edd636c9b08398618f2d..184824716d156f886d6103c9bbaaafdc6d002913 100644 (file)
@@ -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);
index de0076a43331472033eab4736f3662f9e4779a76..f276d7bfc020e3e3cc45ba748eb7c69b6c7185c4 100644 (file)
 +              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);