History

mtd: nand: omap2: Remove omap_nand_platform_data

As driver is now configured using DT, omap_nand_platform_data structure is no longer needed.

Ladislav Michl committed 9 years ago

Commit 086c3211 parent 1533bfa2 files · +8 −46Browse files

Unified · Split

2 files
  1. drivers/mtd/nand/omap2.c +8 −29
  2. include/linux/platform_data/mtd-nand-omap2.h +0 −17
drivers/mtd/nand/omap2.c+8−29
@@ -1588,8 +1588,7 @@ static bool is_elm_present(struct omap_nand_info *info, · 1587 unmodified lines
15881588 return true;
15891589 }
15901590
1591−static bool omap2_nand_ecc_check(struct omap_nand_info *info,
1592− struct omap_nand_platform_data *pdata)
1591+static bool omap2_nand_ecc_check(struct omap_nand_info *info)
15931592 {
15941593 bool ecc_needs_bch, ecc_needs_omap_bch, ecc_needs_elm;
15951594
@@ -1804,7 +1803,6 @@ static const struct mtd_ooblayout_ops omap_sw_ooblayout_ops = { · 208 unmodified lines
18041803 static int omap_nand_probe(struct platform_device *pdev)
18051804 {
18061805 struct omap_nand_info *info;
1807− struct omap_nand_platform_data *pdata = NULL;
18081806 struct mtd_info *mtd;
18091807 struct nand_chip *nand_chip;
18101808 int err;
@@ -1821,27 +1819,9 @@ static int omap_nand_probe(struct platform_device *pdev) · 10 unmodified lines
18211819
18221820 info->pdev = pdev;
18231821
1824− if (dev->of_node) {
1825− if (omap_get_dt_info(dev, info))
1826− return -EINVAL;
1827− } else {
1828− pdata = dev_get_platdata(&pdev->dev);
1829− if (!pdata) {
1830− dev_err(&pdev->dev, "platform data missing\n");
1831− return -EINVAL;
1832− }
1833−
1834− info->gpmc_cs = pdata->cs;
1835− info->reg = pdata->reg;
1836− info->ecc_opt = pdata->ecc_opt;
1837− if (pdata->dev_ready)
1838− dev_info(&pdev->dev, "pdata->dev_ready is deprecated\n");
1839−
1840− info->xfer_type = pdata->xfer_type;
1841− info->devsize = pdata->devsize;
1842− info->elm_of_node = pdata->elm_of_node;
1843− info->flash_bbt = pdata->flash_bbt;
1844− }
1822+ err = omap_get_dt_info(dev, info);
1823+ if (err)
1824+ return err;
18451825
18461826 platform_set_drvdata(pdev, info);
18471827 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) · 154 unmodified lines
20021982 goto return_error;
20031983 }
20041984
2005− if (!omap2_nand_ecc_check(info, pdata)) {
1985+ if (!omap2_nand_ecc_check(info)) {
20061986 err = -EINVAL;
20071987 goto return_error;
20081988 }
@@ -2167,10 +2147,9 @@ scan_tail: · 158 unmodified lines
21672147 if (err)
21682148 goto return_error;
21692149
2170− if (dev->of_node)
2171− mtd_device_register(mtd, NULL, 0);
2172− else
2173− mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
2150+ err = mtd_device_register(mtd, NULL, 0);
2151+ if (err)
2152+ goto return_error;
21742153
21752154 platform_set_drvdata(pdev, mtd);
21762155
include/linux/platform_data/mtd-nand-omap2.h+0−17
@@ -66,21 +66,4 @@ struct gpmc_nand_regs { · 65 unmodified lines
6666 /* Deprecated. Do not use */
6767 void __iomem *gpmc_status;
6868 };
69−
70−struct omap_nand_platform_data {
71− int cs;
72− struct mtd_partition *parts;
73− int nr_parts;
74− bool flash_bbt;
75− enum nand_io xfer_type;
76− int devsize;
77− enum omap_ecc ecc_opt;
78−
79− struct device_node *elm_of_node;
80−
81− /* deprecated */
82− struct gpmc_nand_regs reg;
83− struct device_node *of_node;
84− bool dev_ready;
85−};
8669 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t