can: c_can: checking IS_ERR() instead of NULL
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 1 Aug 2014 08:53:44 +0000 (11:53 +0300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 21 Aug 2014 08:49:59 +0000 (10:49 +0200)
devm_ioremap() returns NULL on error, not an ERR_PTR().

Fixes: 33cf75656923 ('can: c_can_platform: Fix raminit, use devm_ioremap() instead of devm_ioremap_resource()')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v3.11
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/c_can/c_can_platform.c

index 5dede6e6437619f455f19ef6f8277e74e7639997..109cb44291f51f3af4c45979aa3b3ef53099d061 100644 (file)
@@ -280,7 +280,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
 
                priv->raminit_ctrlreg = devm_ioremap(&pdev->dev, res->start,
                                                     resource_size(res));
-               if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
+               if (!priv->raminit_ctrlreg || priv->instance < 0)
                        dev_info(&pdev->dev, "control memory is not used for raminit\n");
                else
                        priv->raminit = c_can_hw_raminit_ti;