can: flexcan: fix 'passing zero to ERR_PTR()' warning
authorYueHaibing <yuehaibing@huawei.com>
Wed, 12 Dec 2018 09:24:01 +0000 (17:24 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 22 Jan 2019 10:34:17 +0000 (11:34 +0100)
Fix a static code checker warning:
drivers/net/can/flexcan.c:1435 flexcan_setup_stop_mode() warn: passing zero to 'PTR_ERR'

Fixes: de3578c198c6 ("can: flexcan: add self wakeup support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c

index 0f36eafe3ac16d5ba55432608acfd12eee0dd8e0..5f097648d12d51f2da07e9610536a8eec18ef537 100644 (file)
@@ -1432,7 +1432,7 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
        gpr_np = of_find_node_by_phandle(phandle);
        if (!gpr_np) {
                dev_dbg(&pdev->dev, "could not find gpr node by phandle\n");
-               return PTR_ERR(gpr_np);
+               return -ENODEV;
        }
 
        priv = netdev_priv(dev);