v4l: ti-vpe: fix devm_ioremap_resource() return value checking
PATCH 1/1 v4l: ti-vpe: fix devm_ioremap_resource() return value checking
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.
---
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(-)
drivers/media/platform/ti-vpe/csc.c +2 -2
@@ -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;
drivers/media/platform/ti-vpe/sc.c +2 -2
@@ -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;
Hi,
Quoted 9 lines · Bartlomiej Zolnierkiewicz
devm_ioremap_resource()returns a pointer to the remapped memory or anERR_PTR()encoded error code on failure. Fix the checks insidecsc_create()andsc_create()accordingly.Cc Archit Taneja <[email protected]>Cc Hans Verkuil <[email protected]>Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>---
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.
Thanks,
Archit
Quoted 38 lines
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
===================================================================drivers/media/platform/ti-vpe/csc.c +2
-2@@ -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
===================================================================drivers/media/platform/ti-vpe/sc.c +2
-2@@ -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;