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
1588 return true;1588 return true;
1589}1589}
1590 1590
1591static bool omap2_nand_ecc_check(struct omap_nand_info *info,1591static bool omap2_nand_ecc_check(struct omap_nand_info *info)
1592 struct omap_nand_platform_data *pdata)
1593{1592{
1594 bool ecc_needs_bch, ecc_needs_omap_bch, ecc_needs_elm;1593 bool ecc_needs_bch, ecc_needs_omap_bch, ecc_needs_elm;
1595 1594
@@ -1804,7 +1803,6 @@ static const struct mtd_ooblayout_ops omap_sw_ooblayout_ops = { · 208 unmodified lines
1804static int omap_nand_probe(struct platform_device *pdev)1803static int omap_nand_probe(struct platform_device *pdev)
1805{1804{
1806 struct omap_nand_info *info;1805 struct omap_nand_info *info;
1807 struct omap_nand_platform_data *pdata = NULL;
1808 struct mtd_info *mtd;1806 struct mtd_info *mtd;
1809 struct nand_chip *nand_chip;1807 struct nand_chip *nand_chip;
1810 int err;1808 int err;
@@ -1821,27 +1819,9 @@ static int omap_nand_probe(struct platform_device *pdev) · 10 unmodified lines
1821 1819
1822 info->pdev = pdev;1820 info->pdev = pdev;
1823 1821
1824 if (dev->of_node) {1822 err = omap_get_dt_info(dev, info);
1825 if (omap_get_dt_info(dev, info))1823 if (err)
1826 return -EINVAL;1824 return err;
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 }
1845 1825
1846 platform_set_drvdata(pdev, info);1826 platform_set_drvdata(pdev, info);
1847 info->ops = gpmc_omap_get_nand_ops(&info->reg, info->gpmc_cs);1827 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
2002 goto return_error;1982 goto return_error;
2003 }1983 }
2004 1984
2005 if (!omap2_nand_ecc_check(info, pdata)) {1985 if (!omap2_nand_ecc_check(info)) {
2006 err = -EINVAL;1986 err = -EINVAL;
2007 goto return_error;1987 goto return_error;
2008 }1988 }
@@ -2167,10 +2147,9 @@ scan_tail: · 158 unmodified lines
2167 if (err)2147 if (err)
2168 goto return_error;2148 goto return_error;
2169 2149
2170 if (dev->of_node)2150 err = mtd_device_register(mtd, NULL, 0);
2171 mtd_device_register(mtd, NULL, 0);2151 if (err)
2172 else2152 goto return_error;
2173 mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
2174 2153
2175 platform_set_drvdata(pdev, mtd);2154 platform_set_drvdata(pdev, mtd);
2176 2155
include/linux/platform_data/mtd-nand-omap2.h+0−17
@@ -66,21 +66,4 @@ struct gpmc_nand_regs { · 65 unmodified lines
66 /* Deprecated. Do not use */66 /* Deprecated. Do not use */
67 void __iomem *gpmc_status;67 void __iomem *gpmc_status;
68};68};
69
70struct 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};
86#endif69#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