linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource
@ 2020-04-09 14:13 Aishwarya R
  2020-04-12 14:32 ` Aishwarya R
  0 siblings, 1 reply; 3+ messages in thread
From: Aishwarya R @ 2020-04-09 14:13 UTC (permalink / raw)
  Cc: Kate Stewart, Lars-Peter Clausen, Yangtao Li, linux-kernel,
	Maxime Ripard, Stephen Boyd, linux-iio, Chen-Yu Tsai,
	linux-arm-kernel, Peter Meerwald-Stadler, Hartmut Knaack,
	Thomas Gleixner, aishwaryarj100, Jonathan Cameron

Use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.

Signed-off-by: Aishwarya R <aishwaryarj100@gmail.com>
---
 drivers/iio/adc/sun4i-gpadc-iio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index 176e1cb4abb1..0f2c1738a90d 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -496,7 +496,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
 				struct iio_dev *indio_dev)
 {
 	struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
-	struct resource *mem;
 	void __iomem *base;
 	int ret;
 
@@ -508,8 +507,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
 	indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels);
 	indio_dev->channels = sun8i_a33_gpadc_channels;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, mem);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource
  2020-04-09 14:13 [PATCH] iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource Aishwarya R
@ 2020-04-12 14:32 ` Aishwarya R
  2020-04-13 15:33   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Aishwarya R @ 2020-04-12 14:32 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Maxime Ripard, Chen-Yu Tsai,
	Enrico Weigelt, Allison Randal, Yangtao Li, Stephen Boyd,
	Aishwarya R, Thomas Gleixner, linux-iio, linux-arm-kernel,
	linux-kernel

From: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>

Use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.Reduces boilerplate and suggested
by coccinelle.

Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
---
 drivers/iio/adc/sun4i-gpadc-iio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index 176e1cb4abb1..0f2c1738a90d 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -496,7 +496,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
 				struct iio_dev *indio_dev)
 {
 	struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
-	struct resource *mem;
 	void __iomem *base;
 	int ret;
 
@@ -508,8 +507,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
 	indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels);
 	indio_dev->channels = sun8i_a33_gpadc_channels;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, mem);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource
  2020-04-12 14:32 ` Aishwarya R
@ 2020-04-13 15:33   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2020-04-13 15:33 UTC (permalink / raw)
  To: Aishwarya R
  Cc: Lars-Peter Clausen, Yangtao Li, linux-kernel, Maxime Ripard,
	Stephen Boyd, linux-iio, Chen-Yu Tsai, linux-arm-kernel,
	Peter Meerwald-Stadler, Hartmut Knaack, Thomas Gleixner,
	Enrico Weigelt, Allison Randal

On Sun, 12 Apr 2020 20:02:18 +0530
Aishwarya R <aishwaryarj100@gmail.com> wrote:

> From: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>
> 
> Use the helper function that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.Reduces boilerplate and suggested
> by coccinelle.
> 
> Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com>

So couple of general things for future reference.
1. New versions of a patch need a title such as [PATCH V2]
2. You have several similar patches, they would have been best sent
   as a series as that lets a maintainer pick them all up in one go.
3. Don't send new versions in reply to older versions.  It doesn't scale
   as we regularly end up 10 or more versions in to a series.  Not to mention
   many reviewers read backwards in time (as often earlier patches are resolved
   before you get to them) so by sending it as a reply you ensured it was much
   less likely to be applied.  Here you were luck as I am on holiday so have
   time to catch up.

Applied to the togreg branch of iio.git with the message above tidied up
a little.  Will be pushed out as testing for the autobuilders to poke at it.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/sun4i-gpadc-iio.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
> index 176e1cb4abb1..0f2c1738a90d 100644
> --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> @@ -496,7 +496,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
>  				struct iio_dev *indio_dev)
>  {
>  	struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
> -	struct resource *mem;
>  	void __iomem *base;
>  	int ret;
>  
> @@ -508,8 +507,7 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev,
>  	indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels);
>  	indio_dev->channels = sun8i_a33_gpadc_channels;
>  
> -	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	base = devm_ioremap_resource(&pdev->dev, mem);
> +	base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(base))
>  		return PTR_ERR(base);
>  


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-13 15:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 14:13 [PATCH] iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource Aishwarya R
2020-04-12 14:32 ` Aishwarya R
2020-04-13 15:33   ` Jonathan Cameron

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).