* [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata
@ 2017-01-16 16:28 Rafał Miłecki
2017-01-17 11:07 ` Kalle Valo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Rafał Miłecki @ 2017-01-16 16:28 UTC (permalink / raw)
To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
Richard Weinberger, Cyrille Pitchen, Kalle Valo
Cc: linux-mtd, linux-wireless, Hauke Mehrtens,
Rafał Miłecki
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 allows cleaning up struct bcma_sflash from unneeded fields.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
Kalle: This is mtd focused patch, so I guess it should go through mtd tree. Do
you find bcma change important enough to care to Ack it? :)
---
drivers/mtd/devices/bcm47xxsflash.c | 6 +++---
include/linux/bcma/bcma_driver_chipcommon.h | 3 ---
2 files changed, 3 insertions(+), 6 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);
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index b20e3d5..2f1c690 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -593,9 +593,6 @@ struct bcma_sflash {
u32 blocksize;
u16 numblocks;
u32 size;
-
- struct mtd_info *mtd;
- void *priv;
};
#endif
--
2.10.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata
2017-01-16 16:28 [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata Rafał Miłecki
@ 2017-01-17 11:07 ` Kalle Valo
2017-02-06 9:46 ` Boris Brezillon
2017-02-08 19:21 ` Brian Norris
2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-01-17 11:07 UTC (permalink / raw)
To: Rafał Miłecki
Cc: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
Richard Weinberger, Cyrille Pitchen, linux-mtd, linux-wireless,
Hauke Mehrtens, Rafał Miłecki
Rafa=C5=82 Mi=C5=82ecki <zajec5@gmail.com> writes:
> From: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>
> We have generic place & helpers for storing platform driver data so
> there is no reason for using custom priv pointer.
>
> This allows cleaning up struct bcma_sflash from unneeded fields.
>
> Signed-off-by: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
> ---
> Kalle: This is mtd focused patch, so I guess it should go through mtd tre=
e. Do
> you find bcma change important enough to care to Ack it? :)
Sure :)
Feel free to take the patch via mtd tree, I'm not expecting to see any
conflicts with this patch. For the bcma part:
Acked-by: Kalle Valo <kvalo@codeaurora.org>
--=20
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata
2017-01-16 16:28 [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata Rafał Miłecki
2017-01-17 11:07 ` Kalle Valo
@ 2017-02-06 9:46 ` Boris Brezillon
2017-02-08 19:21 ` Brian Norris
2 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2017-02-06 9:46 UTC (permalink / raw)
To: Rafał Miłecki
Cc: David Woodhouse, Brian Norris, Marek Vasut, Richard Weinberger,
Cyrille Pitchen, Kalle Valo, linux-mtd, linux-wireless,
Hauke Mehrtens, Rafał Miłecki
On Mon, 16 Jan 2017 17:28:18 +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 allows cleaning up struct bcma_sflash from unneeded fields.
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
> Kalle: This is mtd focused patch, so I guess it should go through mtd tree. Do
> you find bcma change important enough to care to Ack it? :)
> ---
> drivers/mtd/devices/bcm47xxsflash.c | 6 +++---
> include/linux/bcma/bcma_driver_chipcommon.h | 3 ---
> 2 files changed, 3 insertions(+), 6 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);
> diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
> index b20e3d5..2f1c690 100644
> --- a/include/linux/bcma/bcma_driver_chipcommon.h
> +++ b/include/linux/bcma/bcma_driver_chipcommon.h
> @@ -593,9 +593,6 @@ struct bcma_sflash {
> u32 blocksize;
> u16 numblocks;
> u32 size;
> -
> - struct mtd_info *mtd;
> - void *priv;
> };
> #endif
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata
2017-01-16 16:28 [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata Rafał Miłecki
2017-01-17 11:07 ` Kalle Valo
2017-02-06 9:46 ` Boris Brezillon
@ 2017-02-08 19:21 ` Brian Norris
2 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2017-02-08 19:21 UTC (permalink / raw)
To: Rafał Miłecki
Cc: David Woodhouse, Boris Brezillon, Marek Vasut, Richard Weinberger,
Cyrille Pitchen, Kalle Valo, linux-mtd, linux-wireless,
Hauke Mehrtens, Rafał Miłecki
On Mon, Jan 16, 2017 at 05:28:18PM +0100, Rafał Miłecki 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 allows cleaning up struct bcma_sflash from unneeded fields.
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> Kalle: This is mtd focused patch, so I guess it should go through mtd tree. Do
> you find bcma change important enough to care to Ack it? :)
Applied to l2-mtd.git.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-08 19:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-16 16:28 [PATCH V2] mtd: bcm47xxsflash: use platform_(set|get)_drvdata Rafał Miłecki
2017-01-17 11:07 ` Kalle Valo
2017-02-06 9:46 ` Boris Brezillon
2017-02-08 19:21 ` Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).