浏览代码

at91ether: return PTR_ERR if call to clk_get fails

we are currently returning ENODEV, as the clk_get may give a exact
error code in its returned pointer, assign it to the ret by using the
PTR_ERR function, so that the subsequent goto label will jump to the
error path and clean the driver and return the error correctly.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Devendra Naga 13 年之前
父节点
当前提交
3cfc159010
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/net/ethernet/cadence/at91_ether.c

+ 1 - 1
drivers/net/ethernet/cadence/at91_ether.c

@@ -1086,7 +1086,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
 	/* Clock */
 	/* Clock */
 	lp->ether_clk = clk_get(&pdev->dev, "ether_clk");
 	lp->ether_clk = clk_get(&pdev->dev, "ether_clk");
 	if (IS_ERR(lp->ether_clk)) {
 	if (IS_ERR(lp->ether_clk)) {
-		res = -ENODEV;
+		res = PTR_ERR(lp->ether_clk);
 		goto err_ioumap;
 		goto err_ioumap;
 	}
 	}
 	clk_enable(lp->ether_clk);
 	clk_enable(lp->ether_clk);