Skip to content

Commit

Permalink
at91ether: return PTR_ERR if call to clk_get fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Devendra Naga authored and David S. Miller committed Sep 21, 2012
1 parent e3ac104 commit 3cfc159
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/cadence/at91_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ static int __init at91ether_probe(struct platform_device *pdev)
/* Clock */
lp->ether_clk = clk_get(&pdev->dev, "ether_clk");
if (IS_ERR(lp->ether_clk)) {
res = -ENODEV;
res = PTR_ERR(lp->ether_clk);
goto err_ioumap;
}
clk_enable(lp->ether_clk);
Expand Down

0 comments on commit 3cfc159

Please sign in to comment.