summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/omap2.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2016-04-19 20:29:58 +0200
committerBoris Brezillon <boris.brezillon@free-electrons.com>2016-04-19 22:04:54 +0200
commitf679888f29fe5c4a4c44459f2c1fc62b72188773 (patch)
tree9067cfb0cbe4700ce3eb6fe5009a161a5d5e5b38 /drivers/mtd/nand/omap2.c
parent24d990e237d1822fb108ed9be41d1542af001185 (diff)
downloadlinux-stable-f679888f29fe5c4a4c44459f2c1fc62b72188773.tar.gz
linux-stable-f679888f29fe5c4a4c44459f2c1fc62b72188773.tar.bz2
linux-stable-f679888f29fe5c4a4c44459f2c1fc62b72188773.zip
mtd: nand: omap2: rely on generic DT parsing done in nand_scan_ident()
The core now takes care of parsing generic DT properties in nand_scan_ident() when nand_set_flash_node() has been called. Rely on this initialization instead of calling of_get_nand_xxx() manually. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Roger Quadros <rogerq@ti.com> Tested-by: Franklin S Cooper Jr. <fcooper@ti.com>
Diffstat (limited to 'drivers/mtd/nand/omap2.c')
-rw-r--r--drivers/mtd/nand/omap2.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index e0b2b2f0fbde..c59bc85009d7 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -25,7 +25,6 @@
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_device.h>
-#include <linux/of_mtd.h>
#include <linux/mtd/nand_bch.h>
#include <linux/platform_data/elm.h>
@@ -1701,7 +1700,7 @@ static int omap_get_dt_info(struct device *dev, struct omap_nand_info *info)
for (i = 0; i < ARRAY_SIZE(nand_xfer_types); i++) {
if (!strcasecmp(s, nand_xfer_types[i])) {
info->xfer_type = i;
- goto next;
+ return 0;
}
}
@@ -1709,12 +1708,6 @@ static int omap_get_dt_info(struct device *dev, struct omap_nand_info *info)
return -EINVAL;
}
-next:
- of_get_nand_on_flash_bbt(child);
-
- if (of_get_nand_bus_width(child) == 16)
- info->devsize = NAND_BUSWIDTH_16;
-
return 0;
}
@@ -1810,9 +1803,7 @@ static int omap_nand_probe(struct platform_device *pdev)
}
if (info->flash_bbt)
- nand_chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
- else
- nand_chip->options |= NAND_SKIP_BBTSCAN;
+ nand_chip->bbt_options |= NAND_BBT_USE_FLASH;
/* scan NAND device connected to chip controller */
nand_chip->options |= info->devsize & NAND_BUSWIDTH_16;
@@ -1823,6 +1814,11 @@ static int omap_nand_probe(struct platform_device *pdev)
goto return_error;
}
+ if (nand_chip->bbt_options & NAND_BBT_USE_FLASH)
+ nand_chip->bbt_options |= NAND_BBT_NO_OOB;
+ else
+ nand_chip->options |= NAND_SKIP_BBTSCAN;
+
/* re-populate low-level callbacks based on xfer modes */
switch (info->xfer_type) {
case NAND_OMAP_PREFETCH_POLLED: