Skip to content

Commit

Permalink
can: c_can: checking IS_ERR() instead of NULL
Browse files Browse the repository at this point in the history
devm_ioremap() returns NULL on error, not an ERR_PTR().

Fixes: 33cf756 ('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>
  • Loading branch information
Dan Carpenter authored and Marc Kleine-Budde committed Aug 21, 2014
1 parent 9e37bc6 commit 37b75a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/c_can/c_can_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 37b75a3

Please sign in to comment.