mtd: nand: omap: Use gpmc_omap_get_nand_ops() to get NAND registers
authorRoger Quadros <rogerq@ti.com>
Wed, 5 Aug 2015 11:01:50 +0000 (14:01 +0300)
committerRoger Quadros <rogerq@ti.com>
Fri, 15 Apr 2016 08:53:02 +0000 (11:53 +0300)
Deprecate nand register passing via platform data and use
gpmc_omap_get_nand_ops() instead.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/gpmc-nand.c
drivers/mtd/nand/omap2.c
include/linux/platform_data/mtd-nand-omap2.h

index 72918c4973ea7f0cc86da080916c9f72bd327fcd..04e6998c1529dfde9df4896d459792166a64231c 100644 (file)
@@ -121,8 +121,6 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
        if (err < 0)
                goto out_free_cs;
 
-       gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
-
        if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt)) {
                pr_err("omap2-nand: Unsupported NAND ECC scheme selected\n");
                err = -EINVAL;
index 0749ca1a145681552bf2e42b2be96c7d4e09eb4f..cba9bf0adba1e39fc2a241dbb9f1eeb8e5b2a7a7 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/mtd/nand_bch.h>
 #include <linux/platform_data/elm.h>
 
+#include <linux/omap-gpmc.h>
 #include <linux/platform_data/mtd-nand-omap2.h>
 
 #define        DRIVER_NAME     "omap2-nand"
@@ -168,7 +169,9 @@ struct omap_nand_info {
        } iomode;
        u_char                          *buf;
        int                                     buf_len;
+       /* Interface to GPMC */
        struct gpmc_nand_regs           reg;
+       struct gpmc_nand_ops            *ops;
        /* generated at runtime depending on ECC algorithm and layout selected */
        struct nand_ecclayout           oobinfo;
        /* fields specific for BCHx_HW ECC scheme */
@@ -1665,9 +1668,13 @@ static int omap_nand_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, info);
 
+       info->ops = gpmc_omap_get_nand_ops(&info->reg, info->gpmc_cs);
+       if (!info->ops) {
+               dev_err(&pdev->dev, "Failed to get GPMC->NAND interface\n");
+               return -ENODEV;
+       }
        info->pdev              = pdev;
        info->gpmc_cs           = pdata->cs;
-       info->reg               = pdata->reg;
        info->of_node           = pdata->of_node;
        info->ecc_opt           = pdata->ecc_opt;
        nand_chip               = &info->nand;
index 090bbab0130a3d31b226b8fce8b50f9f6b231be9..a067f581e9382eebd8107f55db3514a50adac366 100644 (file)
@@ -75,10 +75,12 @@ struct omap_nand_platform_data {
        enum nand_io            xfer_type;
        int                     devsize;
        enum omap_ecc           ecc_opt;
-       struct gpmc_nand_regs   reg;
 
        /* for passing the partitions */
        struct device_node      *of_node;
        struct device_node      *elm_of_node;
+
+       /* deprecated */
+       struct gpmc_nand_regs   reg;
 };
 #endif