netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: c_can: Fix return value check in c_can_plat_probe()
@ 2014-08-14  0:58 weiyj_lk
  2014-08-14 10:11 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: weiyj_lk @ 2014-08-14  0:58 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, Grant Likely, Rob Herring,
	Thomas Gleixner, Chen Gang, George Cherian, Sachin Kamat,
	Lad, Prabhakar, Pavel Machek, Thor Thayer, Mugunthan V N,
	Wolfram Sang
  Cc: Wei Yongjun, linux-can, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/can/c_can/c_can_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 5dede6e..109cb44 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -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;


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-14 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14  0:58 [PATCH] can: c_can: Fix return value check in c_can_plat_probe() weiyj_lk
2014-08-14 10:11 ` Marc Kleine-Budde

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).