mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
mtd: nand: omap2: Remove omap_nand_platform_data
As driver is now configured using DT, omap_nand_platform_data structure is no longer needed. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
This commit is contained in:
parent
1533bfa6f6
commit
086c321ec5
2 changed files with 8 additions and 46 deletions
|
@ -1588,8 +1588,7 @@ static bool is_elm_present(struct omap_nand_info *info,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool omap2_nand_ecc_check(struct omap_nand_info *info,
|
static bool omap2_nand_ecc_check(struct omap_nand_info *info)
|
||||||
struct omap_nand_platform_data *pdata)
|
|
||||||
{
|
{
|
||||||
bool ecc_needs_bch, ecc_needs_omap_bch, ecc_needs_elm;
|
bool ecc_needs_bch, ecc_needs_omap_bch, ecc_needs_elm;
|
||||||
|
|
||||||
|
@ -1804,7 +1803,6 @@ static const struct mtd_ooblayout_ops omap_sw_ooblayout_ops = {
|
||||||
static int omap_nand_probe(struct platform_device *pdev)
|
static int omap_nand_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct omap_nand_info *info;
|
struct omap_nand_info *info;
|
||||||
struct omap_nand_platform_data *pdata = NULL;
|
|
||||||
struct mtd_info *mtd;
|
struct mtd_info *mtd;
|
||||||
struct nand_chip *nand_chip;
|
struct nand_chip *nand_chip;
|
||||||
int err;
|
int err;
|
||||||
|
@ -1821,27 +1819,9 @@ static int omap_nand_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
info->pdev = pdev;
|
info->pdev = pdev;
|
||||||
|
|
||||||
if (dev->of_node) {
|
err = omap_get_dt_info(dev, info);
|
||||||
if (omap_get_dt_info(dev, info))
|
if (err)
|
||||||
return -EINVAL;
|
return err;
|
||||||
} else {
|
|
||||||
pdata = dev_get_platdata(&pdev->dev);
|
|
||||||
if (!pdata) {
|
|
||||||
dev_err(&pdev->dev, "platform data missing\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
info->gpmc_cs = pdata->cs;
|
|
||||||
info->reg = pdata->reg;
|
|
||||||
info->ecc_opt = pdata->ecc_opt;
|
|
||||||
if (pdata->dev_ready)
|
|
||||||
dev_info(&pdev->dev, "pdata->dev_ready is deprecated\n");
|
|
||||||
|
|
||||||
info->xfer_type = pdata->xfer_type;
|
|
||||||
info->devsize = pdata->devsize;
|
|
||||||
info->elm_of_node = pdata->elm_of_node;
|
|
||||||
info->flash_bbt = pdata->flash_bbt;
|
|
||||||
}
|
|
||||||
|
|
||||||
platform_set_drvdata(pdev, info);
|
platform_set_drvdata(pdev, info);
|
||||||
info->ops = gpmc_omap_get_nand_ops(&info->reg, info->gpmc_cs);
|
info->ops = gpmc_omap_get_nand_ops(&info->reg, info->gpmc_cs);
|
||||||
|
@ -2002,7 +1982,7 @@ static int omap_nand_probe(struct platform_device *pdev)
|
||||||
goto return_error;
|
goto return_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!omap2_nand_ecc_check(info, pdata)) {
|
if (!omap2_nand_ecc_check(info)) {
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto return_error;
|
goto return_error;
|
||||||
}
|
}
|
||||||
|
@ -2167,10 +2147,9 @@ scan_tail:
|
||||||
if (err)
|
if (err)
|
||||||
goto return_error;
|
goto return_error;
|
||||||
|
|
||||||
if (dev->of_node)
|
err = mtd_device_register(mtd, NULL, 0);
|
||||||
mtd_device_register(mtd, NULL, 0);
|
if (err)
|
||||||
else
|
goto return_error;
|
||||||
mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
|
|
||||||
|
|
||||||
platform_set_drvdata(pdev, mtd);
|
platform_set_drvdata(pdev, mtd);
|
||||||
|
|
||||||
|
|
|
@ -66,21 +66,4 @@ struct gpmc_nand_regs {
|
||||||
/* Deprecated. Do not use */
|
/* Deprecated. Do not use */
|
||||||
void __iomem *gpmc_status;
|
void __iomem *gpmc_status;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct omap_nand_platform_data {
|
|
||||||
int cs;
|
|
||||||
struct mtd_partition *parts;
|
|
||||||
int nr_parts;
|
|
||||||
bool flash_bbt;
|
|
||||||
enum nand_io xfer_type;
|
|
||||||
int devsize;
|
|
||||||
enum omap_ecc ecc_opt;
|
|
||||||
|
|
||||||
struct device_node *elm_of_node;
|
|
||||||
|
|
||||||
/* deprecated */
|
|
||||||
struct gpmc_nand_regs reg;
|
|
||||||
struct device_node *of_node;
|
|
||||||
bool dev_ready;
|
|
||||||
};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue