diff mbox

[2/2,media] coda: No need to check the return value of platform_get_resource()

Message ID 1374346129-12907-2-git-send-email-festevam@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam July 20, 2013, 6:48 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

When using devm_ioremap_resource(), we do not need to check the return value of
platform_get_resource(), so just remove it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/media/platform/coda.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Philipp Zabel July 22, 2013, 8:10 a.m. UTC | #1
Am Samstag, den 20.07.2013, 15:48 -0300 schrieb Fabio Estevam:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> When using devm_ioremap_resource(), we do not need to check the return value of
> platform_get_resource(), so just remove it.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/media/platform/coda.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
> index dd76228..236385f 100644
> --- a/drivers/media/platform/coda.c
> +++ b/drivers/media/platform/coda.c
> @@ -2038,11 +2038,6 @@ static int coda_probe(struct platform_device *pdev)
>  
>  	/* Get  memory for physical registers */
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (res == NULL) {
> -		dev_err(&pdev->dev, "failed to get memory region resource\n");
> -		return -ENOENT;
> -	}
> -
>  	dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(dev->regs_base))
>  		return PTR_ERR(dev->regs_base);

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index dd76228..236385f 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -2038,11 +2038,6 @@  static int coda_probe(struct platform_device *pdev)
 
 	/* Get  memory for physical registers */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res == NULL) {
-		dev_err(&pdev->dev, "failed to get memory region resource\n");
-		return -ENOENT;
-	}
-
 	dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(dev->regs_base))
 		return PTR_ERR(dev->regs_base);