Re: [PATCH 10/11] memory: omap-gpmc: Do not use omap_onenand_platform_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 17, 2017 at 11:14:02AM +0300, Roger Quadros wrote:
> Hi,
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 
> On 16/10/17 02:22, Ladislav Michl wrote:
> > OMAP2+ OneNAND MTD driver is now configured using DT, remove
> > now dead code.
> > 
> > Signed-off-by: Ladislav Michl <ladis@xxxxxxxxxxxxxx>
> > ---
> 
> We could squash this into one omap-gpmc patch.

How? MTD driver needs platform data before it gets modified to use DT
only. This is clean up patch after MTD driver gets merged.

> >  drivers/memory/omap-gpmc.c | 37 +------------------------------------
> >  1 file changed, 1 insertion(+), 36 deletions(-)
> > 
> > diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> > index b2fe3be4f914..0229ad589f44 100644
> > --- a/drivers/memory/omap-gpmc.c
> > +++ b/drivers/memory/omap-gpmc.c
> > @@ -32,7 +32,6 @@
> >  #include <linux/pm_runtime.h>
> >  
> >  #include <linux/platform_data/mtd-nand-omap2.h>
> > -#include <linux/platform_data/mtd-onenand-omap2.h>
> >  
> >  #include <asm/mach-types.h>
> >  
> > @@ -2084,9 +2083,6 @@ static void __maybe_unused gpmc_read_timings_dt(struct device_node *np,
> >  		of_property_read_bool(np, "gpmc,time-para-granularity");
> >  }
> >  
> > -extern int
> > -gpmc_omap_onenand_init(struct omap_onenand_platform_data *_onenand_data);
> > -
> >  /**
> >   * gpmc_probe_child - configures the gpmc for a child device
> >   * @pdev:	pointer to gpmc platform device
> > @@ -2098,8 +2094,6 @@ gpmc_omap_onenand_init(struct omap_onenand_platform_data *_onenand_data);
> >  static int gpmc_probe_child(struct platform_device *pdev,
> >  				struct device_node *child)
> >  {
> > -	struct omap_onenand_platform_data *gpmc_onenand_data;
> > -	struct platform_device *child_dev;
> >  	struct gpmc_settings gpmc_s;
> >  	struct gpmc_timings gpmc_t;
> >  	struct resource res;
> > @@ -2241,25 +2235,6 @@ static int gpmc_probe_child(struct platform_device *pdev,
> >  		gpmc_s.device_nand = true;
> >  	} else if (of_device_is_compatible(child, "ti,omap2-onenand") ||
> >  		   of_device_is_compatible(child, "ti,omap3-onenand")) {
> > -		gpmc_onenand_data = devm_kzalloc(&pdev->dev,
> > -						 sizeof(*gpmc_onenand_data),
> > -						 GFP_KERNEL);
> > -		if (!gpmc_onenand_data) {
> > -			ret = -ENOMEM;
> > -			goto err;
> > -		}
> > -
> > -		gpmc_onenand_data->cs = cs;
> > -		gpmc_onenand_data->of_node = child;
> > -		if (!of_property_read_u32(child, "dma-channel", &val))
> > -			gpmc_onenand_data->dma_channel = val;
> > -		else
> > -			gpmc_onenand_data->dma_channel = -1;
> > -
> > -		ret = gpmc_omap_onenand_init(gpmc_onenand_data);
> > -		if (ret)
> > -			goto err;
> > -
> >  		gpmc_omap_onenand_calc_async_timings(&gpmc_t, &gpmc_s);
> >  	} else {
> >  		ret = of_property_read_u32(child, "bank-width",
> > @@ -2308,19 +2283,9 @@ static int gpmc_probe_child(struct platform_device *pdev,
> >  no_timings:
> >  
> >  	/* create platform device, NULL on error or when disabled */
> > -	child_dev = of_platform_device_create(child, NULL, &pdev->dev);
> > -	if (!child_dev)
> > +	if (!of_platform_device_create(child, NULL, &pdev->dev))
> >  		goto err_child_fail;
> >  
> > -	/* Use platform data until OneNAND driver is DT aware */
> > -	if (gpmc_onenand_data) {
> > -		child_dev->name = "omap2-onenand";
> > -		child_dev->dev.platform_data = gpmc_onenand_data;
> > -		ret = platform_device_add_resources(child_dev, &res, 1);
> > -                if (ret)
> > -			goto err_child_fail;
> > -	}
> > -
> >  	/* is child a common bus? */
> >  	if (of_match_node(of_default_bus_match_table, child))
> >  		/* create children and other common bus children */
> > 
> 
> -- 
> cheers,
> -roger
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux