net: ethernet: ti: cpsw: Fix inconsistent IS_ERR and PTR_ERR in cpsw_probe()
authorYueHaibing <yuehaibing@huawei.com>
Tue, 30 Apr 2019 01:55:24 +0000 (01:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 May 2019 18:29:35 +0000 (14:29 -0400)
Fix inconsistent IS_ERR and PTR_ERR in cpsw_probe,
The proper pointer to use is clk instead of mode.

This issue was detected with the help of Coccinelle.

Fixes: 83a8471ba255 ("net: ethernet: ti: cpsw: refactor probe to group common hw initialization")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c

index c3cba46fac9d3d1ba826f76c4b5f777a6ec83cc9..e37680654a13044bc32985eb77899f8105f4bdbd 100644 (file)
@@ -2381,7 +2381,7 @@ static int cpsw_probe(struct platform_device *pdev)
 
        clk = devm_clk_get(dev, "fck");
        if (IS_ERR(clk)) {
-               ret = PTR_ERR(mode);
+               ret = PTR_ERR(clk);
                dev_err(dev, "fck is not found %d\n", ret);
                return ret;
        }