linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: rockchip_saradc: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-08 10:56 Cai Huoqing
  2021-09-19 17:34 ` 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, Heiko Stuebner, linux-iio,
	linux-arm-kernel, linux-rockchip, 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/rockchip_saradc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index a237fe469a30..a56a0d7337ca 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -319,7 +319,6 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
 	struct rockchip_saradc *info = NULL;
 	struct device_node *np = pdev->dev.of_node;
 	struct iio_dev *indio_dev = NULL;
-	struct resource	*mem;
 	const struct of_device_id *match;
 	int ret;
 	int irq;
@@ -348,8 +347,7 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	info->regs = devm_ioremap_resource(&pdev->dev, mem);
+	info->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(info->regs))
 		return PTR_ERR(info->regs);
 
-- 
2.25.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH] iio: adc: rockchip_saradc: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-08 10:56 [PATCH] iio: adc: rockchip_saradc: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-19 17:34 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2021-09-19 17:34 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Lars-Peter Clausen, Heiko Stuebner, linux-iio, linux-arm-kernel,
	linux-rockchip, linux-kernel

On Wed, 8 Sep 2021 18:56:30 +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>

Hi Cai,

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/rockchip_saradc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
> index a237fe469a30..a56a0d7337ca 100644
> --- a/drivers/iio/adc/rockchip_saradc.c
> +++ b/drivers/iio/adc/rockchip_saradc.c
> @@ -319,7 +319,6 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
>  	struct rockchip_saradc *info = NULL;
>  	struct device_node *np = pdev->dev.of_node;
>  	struct iio_dev *indio_dev = NULL;
> -	struct resource	*mem;
>  	const struct of_device_id *match;
>  	int ret;
>  	int irq;
> @@ -348,8 +347,7 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
>  
> -	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	info->regs = devm_ioremap_resource(&pdev->dev, mem);
> +	info->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(info->regs))
>  		return PTR_ERR(info->regs);
>  


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

end of thread, other threads:[~2021-09-19 17:31 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: adc: rockchip_saradc: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-19 17:34 ` 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).