All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: rc: st_rc: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  5:54 ` Cai Huoqing
  0 siblings, 0 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-01  5:54 UTC (permalink / raw)
  To: caihuoqing
  Cc: Patrice Chotard, Sean Young, Mauro Carvalho Chehab,
	linux-arm-kernel, linux-media, 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/media/rc/st_rc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index d79d1e3996b2..4e419dbbacd3 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -231,7 +231,6 @@ static int st_rc_probe(struct platform_device *pdev)
 	int ret = -EINVAL;
 	struct rc_dev *rdev;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	struct st_rc_device *rc_dev;
 	struct device_node *np = pdev->dev.of_node;
 	const char *rx_mode;
@@ -274,9 +273,7 @@ static int st_rc_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	rc_dev->base = devm_ioremap_resource(dev, res);
+	rc_dev->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rc_dev->base)) {
 		ret = PTR_ERR(rc_dev->base);
 		goto err;
-- 
2.25.1


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

* [PATCH] media: rc: st_rc: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  5:54 ` Cai Huoqing
  0 siblings, 0 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-09-01  5:54 UTC (permalink / raw)
  To: caihuoqing
  Cc: Patrice Chotard, Sean Young, Mauro Carvalho Chehab,
	linux-arm-kernel, linux-media, 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/media/rc/st_rc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index d79d1e3996b2..4e419dbbacd3 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -231,7 +231,6 @@ static int st_rc_probe(struct platform_device *pdev)
 	int ret = -EINVAL;
 	struct rc_dev *rdev;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	struct st_rc_device *rc_dev;
 	struct device_node *np = pdev->dev.of_node;
 	const char *rx_mode;
@@ -274,9 +273,7 @@ static int st_rc_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
-	rc_dev->base = devm_ioremap_resource(dev, res);
+	rc_dev->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rc_dev->base)) {
 		ret = PTR_ERR(rc_dev->base);
 		goto err;
-- 
2.25.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] 4+ messages in thread

* Re: [PATCH] media: rc: st_rc: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-01  5:54 ` Cai Huoqing
@ 2021-09-01  7:50   ` Patrice CHOTARD
  -1 siblings, 0 replies; 4+ messages in thread
From: Patrice CHOTARD @ 2021-09-01  7:50 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Sean Young, Mauro Carvalho Chehab, linux-arm-kernel, linux-media,
	linux-kernel

Hi Cai

On 9/1/21 7:54 AM, Cai Huoqing 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>
> ---
>  drivers/media/rc/st_rc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
> index d79d1e3996b2..4e419dbbacd3 100644
> --- a/drivers/media/rc/st_rc.c
> +++ b/drivers/media/rc/st_rc.c
> @@ -231,7 +231,6 @@ static int st_rc_probe(struct platform_device *pdev)
>  	int ret = -EINVAL;
>  	struct rc_dev *rdev;
>  	struct device *dev = &pdev->dev;
> -	struct resource *res;
>  	struct st_rc_device *rc_dev;
>  	struct device_node *np = pdev->dev.of_node;
>  	const char *rx_mode;
> @@ -274,9 +273,7 @@ static int st_rc_probe(struct platform_device *pdev)
>  		goto err;
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> -	rc_dev->base = devm_ioremap_resource(dev, res);
> +	rc_dev->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(rc_dev->base)) {
>  		ret = PTR_ERR(rc_dev->base);
>  		goto err;
> 
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

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

* Re: [PATCH] media: rc: st_rc: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  7:50   ` Patrice CHOTARD
  0 siblings, 0 replies; 4+ messages in thread
From: Patrice CHOTARD @ 2021-09-01  7:50 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Sean Young, Mauro Carvalho Chehab, linux-arm-kernel, linux-media,
	linux-kernel

Hi Cai

On 9/1/21 7:54 AM, Cai Huoqing 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>
> ---
>  drivers/media/rc/st_rc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
> index d79d1e3996b2..4e419dbbacd3 100644
> --- a/drivers/media/rc/st_rc.c
> +++ b/drivers/media/rc/st_rc.c
> @@ -231,7 +231,6 @@ static int st_rc_probe(struct platform_device *pdev)
>  	int ret = -EINVAL;
>  	struct rc_dev *rdev;
>  	struct device *dev = &pdev->dev;
> -	struct resource *res;
>  	struct st_rc_device *rc_dev;
>  	struct device_node *np = pdev->dev.of_node;
>  	const char *rx_mode;
> @@ -274,9 +273,7 @@ static int st_rc_probe(struct platform_device *pdev)
>  		goto err;
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> -	rc_dev->base = devm_ioremap_resource(dev, res);
> +	rc_dev->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(rc_dev->base)) {
>  		ret = PTR_ERR(rc_dev->base);
>  		goto err;
> 
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

_______________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2021-09-01  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  5:54 [PATCH] media: rc: st_rc: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-01  5:54 ` Cai Huoqing
2021-09-01  7:50 ` Patrice CHOTARD
2021-09-01  7:50   ` Patrice CHOTARD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.