diff mbox

[media] v4l: ti-vpe: checking for IS_ERR() instead of NULL

Message ID 20131108100109.GN27977@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Nov. 8, 2013, 10:01 a.m. UTC
devm_ioremap() returns NULL on error, it doesn't return an ERR_PTR.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
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 Nov. 8, 2013, 10:26 a.m. UTC | #1
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
--
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

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