mtd: nand: sh_flctl: 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>
This commit is contained in:
parent
609468f948
commit
14667d8d58
|
@ -31,7 +31,6 @@
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/of_mtd.h>
|
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/sh_dma.h>
|
#include <linux/sh_dma.h>
|
||||||
|
@ -1092,8 +1091,6 @@ static struct sh_flctl_platform_data *flctl_parse_dt(struct device *dev)
|
||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
struct flctl_soc_config *config;
|
struct flctl_soc_config *config;
|
||||||
struct sh_flctl_platform_data *pdata;
|
struct sh_flctl_platform_data *pdata;
|
||||||
struct device_node *dn = dev->of_node;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
match = of_match_device(of_flctl_match, dev);
|
match = of_match_device(of_flctl_match, dev);
|
||||||
if (match)
|
if (match)
|
||||||
|
@ -1113,15 +1110,6 @@ static struct sh_flctl_platform_data *flctl_parse_dt(struct device *dev)
|
||||||
pdata->has_hwecc = config->has_hwecc;
|
pdata->has_hwecc = config->has_hwecc;
|
||||||
pdata->use_holden = config->use_holden;
|
pdata->use_holden = config->use_holden;
|
||||||
|
|
||||||
/* parse user defined options */
|
|
||||||
ret = of_get_nand_bus_width(dn);
|
|
||||||
if (ret == 16)
|
|
||||||
pdata->flcmncr_val |= SEL_16BIT;
|
|
||||||
else if (ret != 8) {
|
|
||||||
dev_err(dev, "%s: invalid bus width\n", __func__);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return pdata;
|
return pdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1184,15 +1172,14 @@ static int flctl_probe(struct platform_device *pdev)
|
||||||
nand->chip_delay = 20;
|
nand->chip_delay = 20;
|
||||||
|
|
||||||
nand->read_byte = flctl_read_byte;
|
nand->read_byte = flctl_read_byte;
|
||||||
|
nand->read_word = flctl_read_word;
|
||||||
nand->write_buf = flctl_write_buf;
|
nand->write_buf = flctl_write_buf;
|
||||||
nand->read_buf = flctl_read_buf;
|
nand->read_buf = flctl_read_buf;
|
||||||
nand->select_chip = flctl_select_chip;
|
nand->select_chip = flctl_select_chip;
|
||||||
nand->cmdfunc = flctl_cmdfunc;
|
nand->cmdfunc = flctl_cmdfunc;
|
||||||
|
|
||||||
if (pdata->flcmncr_val & SEL_16BIT) {
|
if (pdata->flcmncr_val & SEL_16BIT)
|
||||||
nand->options |= NAND_BUSWIDTH_16;
|
nand->options |= NAND_BUSWIDTH_16;
|
||||||
nand->read_word = flctl_read_word;
|
|
||||||
}
|
|
||||||
|
|
||||||
pm_runtime_enable(&pdev->dev);
|
pm_runtime_enable(&pdev->dev);
|
||||||
pm_runtime_resume(&pdev->dev);
|
pm_runtime_resume(&pdev->dev);
|
||||||
|
@ -1203,6 +1190,16 @@ static int flctl_probe(struct platform_device *pdev)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_chip;
|
goto err_chip;
|
||||||
|
|
||||||
|
if (nand->options & NAND_BUSWIDTH_16) {
|
||||||
|
/*
|
||||||
|
* NAND_BUSWIDTH_16 may have been set by nand_scan_ident().
|
||||||
|
* Add the SEL_16BIT flag in pdata->flcmncr_val and re-assign
|
||||||
|
* flctl->flcmncr_base to pdata->flcmncr_val.
|
||||||
|
*/
|
||||||
|
pdata->flcmncr_val |= SEL_16BIT;
|
||||||
|
flctl->flcmncr_base = pdata->flcmncr_val;
|
||||||
|
}
|
||||||
|
|
||||||
ret = flctl_chip_init_tail(flctl_mtd);
|
ret = flctl_chip_init_tail(flctl_mtd);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_chip;
|
goto err_chip;
|
||||||
|
|
Loading…
Reference in New Issue