History

mtd: nand: omap: Use gpmc_omap_get_nand_ops() to get NAND registers

Deprecate nand register passing via platform data and use gpmc_omap_get_nand_ops() instead.

Roger Quadros committed 11 years ago

Commit c509aef1 parent 384258f3 files · +11 −4Browse files

Unified · Split

3 files
  1. arch/arm/mach-omap2/gpmc-nand.c +0 −2
  2. drivers/mtd/nand/omap2.c +8 −1
  3. include/linux/platform_data/mtd-nand-omap2.h +3 −1
arch/arm/mach-omap2/gpmc-nand.c+0−2
@@ -121,8 +121,6 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, · 120 unmodified lines
121121 if (err < 0)
122122 goto out_free_cs;
123123
124− gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
125−
126124 if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt)) {
127125 pr_err("omap2-nand: Unsupported NAND ECC scheme selected\n");
128126 err = -EINVAL;
drivers/mtd/nand/omap2.c+8−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/mtd/nand_bch.h>
2929 #include <linux/platform_data/elm.h>
3030
31+#include <linux/omap-gpmc.h>
3132 #include <linux/platform_data/mtd-nand-omap2.h>
3233
3334 #define DRIVER_NAME "omap2-nand"
@@ -168,7 +169,9 @@ struct omap_nand_info { · 134 unmodified lines
168169 } iomode;
169170 u_char *buf;
170171 int buf_len;
172+ /* Interface to GPMC */
171173 struct gpmc_nand_regs reg;
174+ struct gpmc_nand_ops *ops;
172175 /* generated at runtime depending on ECC algorithm and layout selected */
173176 struct nand_ecclayout oobinfo;
174177 /* fields specific for BCHx_HW ECC scheme */
@@ -1665,9 +1668,13 @@ static int omap_nand_probe(struct platform_device *pdev) · 1490 unmodified lines
16651668
16661669 platform_set_drvdata(pdev, info);
16671670
1671+ info->ops = gpmc_omap_get_nand_ops(&info->reg, info->gpmc_cs);
1672+ if (!info->ops) {
1673+ dev_err(&pdev->dev, "Failed to get GPMC->NAND interface\n");
1674+ return -ENODEV;
1675+ }
16681676 info->pdev = pdev;
16691677 info->gpmc_cs = pdata->cs;
1670− info->reg = pdata->reg;
16711678 info->of_node = pdata->of_node;
16721679 info->ecc_opt = pdata->ecc_opt;
16731680 nand_chip = &info->nand;
include/linux/platform_data/mtd-nand-omap2.h+3−1
@@ -75,10 +75,12 @@ struct omap_nand_platform_data { · 74 unmodified lines
7575 enum nand_io xfer_type;
7676 int devsize;
7777 enum omap_ecc ecc_opt;
78− struct gpmc_nand_regs reg;
7978
8079 /* for passing the partitions */
8180 struct device_node *of_node;
8281 struct device_node *elm_of_node;
82+
83+ /* deprecated */
84+ struct gpmc_nand_regs reg;
8385 };
8486 #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