From 691903f932c5feafc149e2877478ef26b198eddb Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 18 Mar 2014 07:41:42 -0300 Subject: [PATCH] [media] 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. Cc: Archit Taneja Signed-off-by: Bartlomiej Zolnierkiewicz Tested-by: Archit Taneja Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/ti-vpe/csc.c | 4 ++-- drivers/media/platform/ti-vpe/sc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti-vpe/csc.c b/drivers/media/platform/ti-vpe/csc.c index acfea500710e..3374e0490cb0 100644 --- a/drivers/media/platform/ti-vpe/csc.c +++ b/drivers/media/platform/ti-vpe/csc.c @@ -187,9 +187,9 @@ struct csc_data *csc_create(struct platform_device *pdev) } 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; diff --git a/drivers/media/platform/ti-vpe/sc.c b/drivers/media/platform/ti-vpe/sc.c index 93f0af546b76..6314171ffe9b 100644 --- a/drivers/media/platform/ti-vpe/sc.c +++ b/drivers/media/platform/ti-vpe/sc.c @@ -302,9 +302,9 @@ struct sc_data *sc_create(struct platform_device *pdev) } 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; -- 2.20.1