* [patch] [media] v4l: ti-vpe: checking for IS_ERR() instead of NULL
@ 2013-11-08 10:01 Dan Carpenter
2013-11-08 10:38 ` Archit Taneja
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-11-08 10:01 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Grant Likely, Rob Herring, Archit Taneja, Hans Verkuil,
Kamil Debski, linux-media, kernel-janitors
devm_ioremap() returns NULL on error, it doesn't return an ERR_PTR.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index 4e58069..e163466 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -1962,8 +1962,8 @@ static int vpe_probe(struct platform_device *pdev)
* registers based on the sub block base addresses
*/
dev->base = devm_ioremap(&pdev->dev, res->start, SZ_32K);
- if (IS_ERR(dev->base)) {
- ret = PTR_ERR(dev->base);
+ if (!dev->base) {
+ ret = -ENOMEM;
goto v4l2_dev_unreg;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] [media] v4l: ti-vpe: checking for IS_ERR() instead of NULL
2013-11-08 10:01 [patch] [media] v4l: ti-vpe: checking for IS_ERR() instead of NULL Dan Carpenter
@ 2013-11-08 10:38 ` Archit Taneja
0 siblings, 0 replies; 2+ messages in thread
From: Archit Taneja @ 2013-11-08 10:38 UTC (permalink / raw)
To: Dan Carpenter, Mauro Carvalho Chehab
Cc: Grant Likely, Rob Herring, Hans Verkuil, Kamil Debski,
linux-media, kernel-janitors
Hi Dan,
On Friday 08 November 2013 03:31 PM, Dan Carpenter wrote:
> devm_ioremap() returns NULL on error, it doesn't return an ERR_PTR.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
> index 4e58069..e163466 100644
> --- a/drivers/media/platform/ti-vpe/vpe.c
> +++ b/drivers/media/platform/ti-vpe/vpe.c
> @@ -1962,8 +1962,8 @@ static int vpe_probe(struct platform_device *pdev)
> * registers based on the sub block base addresses
> */
> dev->base = devm_ioremap(&pdev->dev, res->start, SZ_32K);
> - if (IS_ERR(dev->base)) {
> - ret = PTR_ERR(dev->base);
> + if (!dev->base) {
> + ret = -ENOMEM;
> goto v4l2_dev_unreg;
> }
Thanks for the patch, this was addressed in Wei's patch though:
"v4l: ti-vpe: fix return value check in vpe_probe()"
Thanks,
Archit
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-08 10:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08 10:01 [patch] [media] v4l: ti-vpe: checking for IS_ERR() instead of NULL Dan Carpenter
2013-11-08 10:38 ` Archit Taneja
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).