diff mbox

v4l: ti-vpe: fix devm_ioremap_resource() return value checking

Message ID 2203316.gzhRfbGDkb@amdc1032 (mailing list archive)
State New, archived
Headers show

Commit Message

Bartlomiej Zolnierkiewicz March 18, 2014, 10:41 a.m. UTC
devm_ioremap_resource() returns a pointer to the remapped memory or
an ERR_PTR() encoded error code on failure.  Fix the checks inside
csc_create() and sc_create() accordingly.

Cc: Archit Taneja <archit@ti.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
Compile tested only.

 drivers/media/platform/ti-vpe/csc.c |    4 ++--
 drivers/media/platform/ti-vpe/sc.c  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)


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

Comments

archit taneja March 20, 2014, 8:39 a.m. UTC | #1
Hi,

On Tuesday 18 March 2014 04:11 PM, Bartlomiej Zolnierkiewicz wrote:
> devm_ioremap_resource() returns a pointer to the remapped memory or
> an ERR_PTR() encoded error code on failure.  Fix the checks inside
> csc_create() and sc_create() accordingly.
>
> Cc: Archit Taneja <archit@ti.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
> Compile tested only.

Thanks for the patch.

It looks like this wasn't patch created using git-format-patch. I can 
convert it if needed.

Tested-by: Archit Taneja<archit@ti.com>

Thanks,
Archit

>
>   drivers/media/platform/ti-vpe/csc.c |    4 ++--
>   drivers/media/platform/ti-vpe/sc.c  |    4 ++--
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> Index: b/drivers/media/platform/ti-vpe/csc.c
> ===================================================================
> --- a/drivers/media/platform/ti-vpe/csc.c	2014-03-14 16:45:25.848724010 +0100
> +++ b/drivers/media/platform/ti-vpe/csc.c	2014-03-18 11:01:36.595182833 +0100
> @@ -187,9 +187,9 @@ struct csc_data *csc_create(struct platf
>   	}
>
>   	csc->base = devm_ioremap_resource(&pdev->dev, csc->res);
> -	if (!csc->base) {
> +	if (IS_ERR(csc->base)) {
>   		dev_err(&pdev->dev, "failed to ioremap\n");
> -		return ERR_PTR(-ENOMEM);
> +		return csc->base;
>   	}
>
>   	return csc;
> Index: b/drivers/media/platform/ti-vpe/sc.c
> ===================================================================
> --- a/drivers/media/platform/ti-vpe/sc.c	2014-03-14 16:45:25.848724010 +0100
> +++ b/drivers/media/platform/ti-vpe/sc.c	2014-03-18 11:02:09.555182273 +0100
> @@ -302,9 +302,9 @@ struct sc_data *sc_create(struct platfor
>   	}
>
>   	sc->base = devm_ioremap_resource(&pdev->dev, sc->res);
> -	if (!sc->base) {
> +	if (IS_ERR(sc->base)) {
>   		dev_err(&pdev->dev, "failed to ioremap\n");
> -		return ERR_PTR(-ENOMEM);
> +		return sc->base;
>   	}
>
>   	return sc;
>

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

Index: b/drivers/media/platform/ti-vpe/csc.c
===================================================================
--- a/drivers/media/platform/ti-vpe/csc.c	2014-03-14 16:45:25.848724010 +0100
+++ b/drivers/media/platform/ti-vpe/csc.c	2014-03-18 11:01:36.595182833 +0100
@@ -187,9 +187,9 @@  struct csc_data *csc_create(struct platf
 	}
 
 	csc->base = devm_ioremap_resource(&pdev->dev, csc->res);
-	if (!csc->base) {
+	if (IS_ERR(csc->base)) {
 		dev_err(&pdev->dev, "failed to ioremap\n");
-		return ERR_PTR(-ENOMEM);
+		return csc->base;
 	}
 
 	return csc;
Index: b/drivers/media/platform/ti-vpe/sc.c
===================================================================
--- a/drivers/media/platform/ti-vpe/sc.c	2014-03-14 16:45:25.848724010 +0100
+++ b/drivers/media/platform/ti-vpe/sc.c	2014-03-18 11:02:09.555182273 +0100
@@ -302,9 +302,9 @@  struct sc_data *sc_create(struct platfor
 	}
 
 	sc->base = devm_ioremap_resource(&pdev->dev, sc->res);
-	if (!sc->base) {
+	if (IS_ERR(sc->base)) {
 		dev_err(&pdev->dev, "failed to ioremap\n");
-		return ERR_PTR(-ENOMEM);
+		return sc->base;
 	}
 
 	return sc;