[PATCH v9 3/9] mtd: nand: omap: cleanup: replace local references with generic framework names
Brian Norris
computersforpeace at gmail.com
Wed Oct 16 14:30:24 PDT 2013
Hi Pekon,
On Tue, Oct 15, 2013 at 11:19:51AM +0530, Pekon Gupta wrote:
> This patch updates following in omap_nand_probe() and omap_nand_remove()
> - replaces "info->nand" with "nand_chip" (struct nand_chip *nand_chip)
> - replaces "info->mtd" with "mtd" (struct mtd_info *mtd)
> - white-space and formatting cleanup
>
> Signed-off-by: Pekon Gupta <pekon at ti.com>
This patch looks good. Thanks for being consistent.
> ---
> drivers/mtd/nand/omap2.c | 112 ++++++++++++++++++++++++-----------------------
> 1 file changed, 57 insertions(+), 55 deletions(-)
>
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 8d521aa..5596368 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
...
> @@ -1846,17 +1848,16 @@ static int omap_nand_probe(struct platform_device *pdev)
> spin_lock_init(&info->controller.lock);
> init_waitqueue_head(&info->controller.wq);
>
> - info->pdev = pdev;
> -
> + info->pdev = pdev;
> info->gpmc_cs = pdata->cs;
> info->reg = pdata->reg;
> -
> - info->mtd.priv = &info->nand;
> - info->mtd.name = dev_name(&pdev->dev);
> - info->mtd.owner = THIS_MODULE;
> -
> - info->nand.options = pdata->devsize;
> - info->nand.options |= NAND_SKIP_BBTSCAN;
> + mtd = &info->mtd;
> + mtd->priv = &info->nand;
> + mtd->name = dev_name(&pdev->dev);
> + mtd->owner = THIS_MODULE;
> + nand_chip = &info->nand;
> + nand_chip->options = pdata->devsize;
Trivial side comment: the 'devsize' field is not named very
informatively. It is apparently just a way to specify nand_chip.options,
and it is only actually used for setting a buswidth. (It is also badly
named nand_type in other places.) Not sure if it's worth improving, or
even dropping at some later point in time.
> + nand_chip->options |= NAND_SKIP_BBTSCAN;
> #ifdef CONFIG_MTD_NAND_OMAP_BCH
> info->of_node = pdata->of_node;
> #endif
[...]
Brian
More information about the linux-mtd
mailing list