linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: ep93xx: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-08 10:56 Cai Huoqing
  2021-09-11 17:16 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-09-08 10:56 UTC (permalink / raw)
  To: caihuoqing; +Cc: Jonathan Cameron, Lars-Peter Clausen, linux-iio, linux-kernel

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/iio/adc/ep93xx_adc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/adc/ep93xx_adc.c b/drivers/iio/adc/ep93xx_adc.c
index 8edd6407b7c3..fd5a9404c8dc 100644
--- a/drivers/iio/adc/ep93xx_adc.c
+++ b/drivers/iio/adc/ep93xx_adc.c
@@ -156,15 +156,13 @@ static int ep93xx_adc_probe(struct platform_device *pdev)
 	struct iio_dev *iiodev;
 	struct ep93xx_adc_priv *priv;
 	struct clk *pclk;
-	struct resource *res;
 
 	iiodev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv));
 	if (!iiodev)
 		return -ENOMEM;
 	priv = iio_priv(iiodev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->base = devm_ioremap_resource(&pdev->dev, res);
+	priv->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->base))
 		return PTR_ERR(priv->base);
 
-- 
2.25.1


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

* Re: [PATCH] iio: ep93xx: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-08 10:56 [PATCH] iio: ep93xx: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-11 17:16 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2021-09-11 17:16 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Lars-Peter Clausen, linux-iio, linux-kernel, Alexander Sverdlin

On Wed, 8 Sep 2021 18:56:45 +0800
Cai Huoqing <caihuoqing@baidu.com> wrote:

> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>

+CC Alexander who wrote this driver.

Given this one is less active than the others you've sent I'll pick it up now.
(the others will wait a few days to see if we get reviews from anyone else).

Applied to the togreg branch of iio.git and pushed out as testing for 0-day
to see if it can find anything we missed.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ep93xx_adc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/ep93xx_adc.c b/drivers/iio/adc/ep93xx_adc.c
> index 8edd6407b7c3..fd5a9404c8dc 100644
> --- a/drivers/iio/adc/ep93xx_adc.c
> +++ b/drivers/iio/adc/ep93xx_adc.c
> @@ -156,15 +156,13 @@ static int ep93xx_adc_probe(struct platform_device *pdev)
>  	struct iio_dev *iiodev;
>  	struct ep93xx_adc_priv *priv;
>  	struct clk *pclk;
> -	struct resource *res;
>  
>  	iiodev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv));
>  	if (!iiodev)
>  		return -ENOMEM;
>  	priv = iio_priv(iiodev);
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	priv->base = devm_ioremap_resource(&pdev->dev, res);
> +	priv->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(priv->base))
>  		return PTR_ERR(priv->base);
>  


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

end of thread, other threads:[~2021-09-11 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 10:56 [PATCH] iio: ep93xx: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-11 17:16 ` 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).