public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "David Woodhouse" <dwmw2@infradead.org>,
	"Brian Norris" <computersforpeace@gmail.com>,
	"Marek Vasut" <marek.vasut@gmail.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Cyrille Pitchen" <cyrille.pitchen@atmel.com>,
	linux-mtd@lists.infradead.org,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH] mtd: bcm47xxsflash: use platform_(set|get)_drvdata
Date: Mon, 16 Jan 2017 15:21:30 +0100	[thread overview]
Message-ID: <20170116152130.5c4b01d9@bbrezillon> (raw)
In-Reply-To: <20170116130409.2686-1-zajec5@gmail.com>

On Mon, 16 Jan 2017 14:04:09 +0100
Rafał Miłecki <zajec5@gmail.com> wrote:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> We have generic place & helpers for storing platform driver data so
> there is no reason for using custom priv pointer.
> 
> This patch will be followed by cleaning struct bcma_sflash which will go
> through another tree where bcma development happens.

Why not removing the ->priv field from the bcma_sflash struct
definition in this patch?
If it needs to go through a different tree we can ack the patch and let
the other maintainer(s) take the whole series.

Note that ->mtd seems to be unused, and should probably be removed as
well (in a separate patch of course). But I guess you already know that.

> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  drivers/mtd/devices/bcm47xxsflash.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/devices/bcm47xxsflash.c b/drivers/mtd/devices/bcm47xxsflash.c
> index 514be04..4decd8c 100644
> --- a/drivers/mtd/devices/bcm47xxsflash.c
> +++ b/drivers/mtd/devices/bcm47xxsflash.c
> @@ -284,7 +284,6 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
>  	b47s = devm_kzalloc(dev, sizeof(*b47s), GFP_KERNEL);
>  	if (!b47s)
>  		return -ENOMEM;
> -	sflash->priv = b47s;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
> @@ -334,6 +333,8 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
>  	b47s->size = sflash->size;
>  	bcm47xxsflash_fill_mtd(b47s, &pdev->dev);
>  
> +	platform_set_drvdata(pdev, b47s);
> +
>  	err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0);
>  	if (err) {
>  		pr_err("Failed to register MTD device: %d\n", err);
> @@ -349,8 +350,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)
>  
>  static int bcm47xxsflash_bcma_remove(struct platform_device *pdev)
>  {
> -	struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev);
> -	struct bcm47xxsflash *b47s = sflash->priv;
> +	struct bcm47xxsflash *b47s = platform_get_drvdata(pdev);
>  
>  	mtd_device_unregister(&b47s->mtd);
>  	iounmap(b47s->window);

  parent reply	other threads:[~2017-01-16 14:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 13:04 [PATCH] mtd: bcm47xxsflash: use platform_(set|get)_drvdata Rafał Miłecki
2017-01-16 13:31 ` Marek Vasut
2017-01-16 14:21 ` Boris Brezillon [this message]
2017-01-16 16:12   ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170116152130.5c4b01d9@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=hauke@hauke-m.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox