As driver is now configured using DT, omap_nand_platform_data structure is no longer needed.
Unified · Split
| @@ -1588,8 +1588,7 @@ static bool is_elm_present(struct omap_nand_info *info, · 1587 unmodified lines | ||
| 1588 | 1588 | return true; |
| 1589 | 1589 | } |
| 1590 | 1590 | |
| 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) | |
| 1593 | 1592 | { |
| 1594 | 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 | ||
| 1804 | 1803 | static int omap_nand_probe(struct platform_device *pdev) |
| 1805 | 1804 | { |
| 1806 | 1805 | struct omap_nand_info *info; |
| 1807 | − struct omap_nand_platform_data *pdata = NULL; | |
| 1808 | 1806 | struct mtd_info *mtd; |
| 1809 | 1807 | struct nand_chip *nand_chip; |
| 1810 | 1808 | int err; |
| @@ -1821,27 +1819,9 @@ static int omap_nand_probe(struct platform_device *pdev) · 10 unmodified lines | ||
| 1821 | 1819 | |
| 1822 | 1820 | info->pdev = pdev; |
| 1823 | 1821 | |
| 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; | |
| 1845 | 1825 | |
| 1846 | 1826 | platform_set_drvdata(pdev, info); |
| 1847 | 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 | 1982 | goto return_error; |
| 2003 | 1983 | } |
| 2004 | 1984 | |
| 2005 | − if (!omap2_nand_ecc_check(info, pdata)) { | |
| 1985 | + if (!omap2_nand_ecc_check(info)) { | |
| 2006 | 1986 | err = -EINVAL; |
| 2007 | 1987 | goto return_error; |
| 2008 | 1988 | } |
| @@ -2167,10 +2147,9 @@ scan_tail: · 158 unmodified lines | ||
| 2167 | 2147 | if (err) |
| 2168 | 2148 | goto return_error; |
| 2169 | 2149 | |
| 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; | |
| 2174 | 2153 | |
| 2175 | 2154 | platform_set_drvdata(pdev, mtd); |
| 2176 | 2155 | |
| @@ -66,21 +66,4 @@ struct gpmc_nand_regs { · 65 unmodified lines | ||
| 66 | 66 | /* Deprecated. Do not use */ |
| 67 | 67 | void __iomem *gpmc_status; |
| 68 | 68 | }; |
| 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 | −}; | |
| 86 | 69 | #endif |