diff options
| author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-04-19 14:29:58 -0400 |
|---|---|---|
| committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-04-19 16:04:54 -0400 |
| commit | f679888f29fe5c4a4c44459f2c1fc62b72188773 (patch) | |
| tree | 9067cfb0cbe4700ce3eb6fe5009a161a5d5e5b38 /drivers | |
| parent | 24d990e237d1822fb108ed9be41d1542af001185 (diff) | |
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')
| -rw-r--r-- | drivers/memory/omap-gpmc.c | 4 | ||||
| -rw-r--r-- | drivers/mtd/nand/omap2.c | 18 |
2 files changed, 9 insertions, 13 deletions
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 33d69b1e4c31..af4884ba6b7c 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c | |||
| @@ -27,7 +27,6 @@ | |||
| 27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
| 28 | #include <linux/of.h> | 28 | #include <linux/of.h> |
| 29 | #include <linux/of_address.h> | 29 | #include <linux/of_address.h> |
| 30 | #include <linux/of_mtd.h> | ||
| 31 | #include <linux/of_device.h> | 30 | #include <linux/of_device.h> |
| 32 | #include <linux/of_platform.h> | 31 | #include <linux/of_platform.h> |
| 33 | #include <linux/omap-gpmc.h> | 32 | #include <linux/omap-gpmc.h> |
| @@ -2066,7 +2065,8 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, | |||
| 2066 | 2065 | ||
| 2067 | if (of_device_is_compatible(child, "ti,omap2-nand")) { | 2066 | if (of_device_is_compatible(child, "ti,omap2-nand")) { |
| 2068 | /* NAND specific setup */ | 2067 | /* NAND specific setup */ |
| 2069 | val = of_get_nand_bus_width(child); | 2068 | val = 8; |
| 2069 | of_property_read_u32(child, "nand-bus-width", &val); | ||
| 2070 | switch (val) { | 2070 | switch (val) { |
| 2071 | case 8: | 2071 | case 8: |
| 2072 | gpmc_s.device_width = GPMC_DEVWIDTH_8BIT; | 2072 | gpmc_s.device_width = GPMC_DEVWIDTH_8BIT; |
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 @@ | |||
| 25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
| 26 | #include <linux/of.h> | 26 | #include <linux/of.h> |
| 27 | #include <linux/of_device.h> | 27 | #include <linux/of_device.h> |
| 28 | #include <linux/of_mtd.h> | ||
| 29 | 28 | ||
| 30 | #include <linux/mtd/nand_bch.h> | 29 | #include <linux/mtd/nand_bch.h> |
| 31 | #include <linux/platform_data/elm.h> | 30 | #include <linux/platform_data/elm.h> |
| @@ -1701,7 +1700,7 @@ static int omap_get_dt_info(struct device *dev, struct omap_nand_info *info) | |||
| 1701 | for (i = 0; i < ARRAY_SIZE(nand_xfer_types); i++) { | 1700 | for (i = 0; i < ARRAY_SIZE(nand_xfer_types); i++) { |
| 1702 | if (!strcasecmp(s, nand_xfer_types[i])) { | 1701 | if (!strcasecmp(s, nand_xfer_types[i])) { |
| 1703 | info->xfer_type = i; | 1702 | info->xfer_type = i; |
| 1704 | goto next; | 1703 | return 0; |
| 1705 | } | 1704 | } |
| 1706 | } | 1705 | } |
| 1707 | 1706 | ||
| @@ -1709,12 +1708,6 @@ static int omap_get_dt_info(struct device *dev, struct omap_nand_info *info) | |||
| 1709 | return -EINVAL; | 1708 | return -EINVAL; |
| 1710 | } | 1709 | } |
| 1711 | 1710 | ||
| 1712 | next: | ||
| 1713 | of_get_nand_on_flash_bbt(child); | ||
| 1714 | |||
| 1715 | if (of_get_nand_bus_width(child) == 16) | ||
| 1716 | info->devsize = NAND_BUSWIDTH_16; | ||
| 1717 | |||
| 1718 | return 0; | 1711 | return 0; |
| 1719 | } | 1712 | } |
| 1720 | 1713 | ||
| @@ -1810,9 +1803,7 @@ static int omap_nand_probe(struct platform_device *pdev) | |||
| 1810 | } | 1803 | } |
| 1811 | 1804 | ||
| 1812 | if (info->flash_bbt) | 1805 | if (info->flash_bbt) |
| 1813 | nand_chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB; | 1806 | nand_chip->bbt_options |= NAND_BBT_USE_FLASH; |
| 1814 | else | ||
| 1815 | nand_chip->options |= NAND_SKIP_BBTSCAN; | ||
| 1816 | 1807 | ||
| 1817 | /* scan NAND device connected to chip controller */ | 1808 | /* scan NAND device connected to chip controller */ |
| 1818 | nand_chip->options |= info->devsize & NAND_BUSWIDTH_16; | 1809 | nand_chip->options |= info->devsize & NAND_BUSWIDTH_16; |
| @@ -1823,6 +1814,11 @@ static int omap_nand_probe(struct platform_device *pdev) | |||
| 1823 | goto return_error; | 1814 | goto return_error; |
| 1824 | } | 1815 | } |
| 1825 | 1816 | ||
| 1817 | if (nand_chip->bbt_options & NAND_BBT_USE_FLASH) | ||
| 1818 | nand_chip->bbt_options |= NAND_BBT_NO_OOB; | ||
| 1819 | else | ||
| 1820 | nand_chip->options |= NAND_SKIP_BBTSCAN; | ||
| 1821 | |||
| 1826 | /* re-populate low-level callbacks based on xfer modes */ | 1822 | /* re-populate low-level callbacks based on xfer modes */ |
| 1827 | switch (info->xfer_type) { | 1823 | switch (info->xfer_type) { |
| 1828 | case NAND_OMAP_PREFETCH_POLLED: | 1824 | case NAND_OMAP_PREFETCH_POLLED: |
