linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] staging: media: cedrus: use devm_platform_ioremap_resource() to simplify code
@ 2019-10-16  8:56 YueHaibing
  2019-10-17  7:26 ` Paul Kocialkowski
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-10-16  8:56 UTC (permalink / raw)
  To: mripard, paul.kocialkowski, mchehab, gregkh, wens
  Cc: linux-media, devel, linux-arm-kernel, linux-kernel, YueHaibing

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
index a942cd9..f19b87c 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
@@ -146,7 +146,6 @@ static irqreturn_t cedrus_irq(int irq, void *data)
 int cedrus_hw_probe(struct cedrus_dev *dev)
 {
 	const struct cedrus_variant *variant;
-	struct resource *res;
 	int irq_dec;
 	int ret;
 
@@ -225,8 +224,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
 		goto err_sram;
 	}
 
-	res = platform_get_resource(dev->pdev, IORESOURCE_MEM, 0);
-	dev->base = devm_ioremap_resource(dev->dev, res);
+	dev->base = devm_platform_ioremap_resource(dev->pdev, 0);
 	if (IS_ERR(dev->base)) {
 		dev_err(dev->dev, "Failed to map registers\n");
 
-- 
2.7.4



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

* Re: [PATCH -next] staging: media: cedrus: use devm_platform_ioremap_resource() to simplify code
  2019-10-16  8:56 [PATCH -next] staging: media: cedrus: use devm_platform_ioremap_resource() to simplify code YueHaibing
@ 2019-10-17  7:26 ` Paul Kocialkowski
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Kocialkowski @ 2019-10-17  7:26 UTC (permalink / raw)
  To: YueHaibing
  Cc: mripard, mchehab, gregkh, wens, linux-media, devel,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1486 bytes --]

Hi,

On Wed 16 Oct 19, 16:56, YueHaibing wrote:
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.

This is still:
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Please collect the tag in your next version, if there's a need for one.

Cheers,

Paul

> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> index a942cd9..f19b87c 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> @@ -146,7 +146,6 @@ static irqreturn_t cedrus_irq(int irq, void *data)
>  int cedrus_hw_probe(struct cedrus_dev *dev)
>  {
>  	const struct cedrus_variant *variant;
> -	struct resource *res;
>  	int irq_dec;
>  	int ret;
>  
> @@ -225,8 +224,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
>  		goto err_sram;
>  	}
>  
> -	res = platform_get_resource(dev->pdev, IORESOURCE_MEM, 0);
> -	dev->base = devm_ioremap_resource(dev->dev, res);
> +	dev->base = devm_platform_ioremap_resource(dev->pdev, 0);
>  	if (IS_ERR(dev->base)) {
>  		dev_err(dev->dev, "Failed to map registers\n");
>  
> -- 
> 2.7.4
> 
> 

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2019-10-17  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16  8:56 [PATCH -next] staging: media: cedrus: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-10-17  7:26 ` Paul Kocialkowski

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