From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Archit Taneja <archit@ti.com>,
Hans Verkuil <hans.verkuil@cisco.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] v4l: ti-vpe: fix devm_ioremap_resource() return value checking
Date: Tue, 18 Mar 2014 11:41:42 +0100 [thread overview]
Message-ID: <2203316.gzhRfbGDkb@amdc1032> (raw)
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(-)
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;
next reply other threads:[~2014-03-18 10:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 10:41 Bartlomiej Zolnierkiewicz [this message]
2014-03-20 8:39 ` [PATCH] v4l: ti-vpe: fix devm_ioremap_resource() return value checking Archit Taneja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2203316.gzhRfbGDkb@amdc1032 \
--to=b.zolnierkie@samsung.com \
--cc=archit@ti.com \
--cc=hans.verkuil@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox