Skip to content

Commit c509aef

Browse files
author
Roger Quadros
committed
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. Signed-off-by: Roger Quadros <[email protected]> Acked-by: Brian Norris <[email protected]> Acked-by: Tony Lindgren <[email protected]>
1 parent 384258f commit c509aef

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

arch/arm/mach-omap2/gpmc-nand.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
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 {
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)
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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ struct omap_nand_platform_data {
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

0 commit comments

Comments
 (0)