* [PATCH] at91ether: return PTR_ERR if call to clk_get fails
@ 2012-09-20 7:04 Devendra Naga
2012-09-20 7:42 ` Nicolas Ferre
0 siblings, 1 reply; 3+ messages in thread
From: Devendra Naga @ 2012-09-20 7:04 UTC (permalink / raw)
To: Nicolas Ferre, netdev; +Cc: Devendra Naga
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>
---
drivers/net/ethernet/cadence/at91_ether.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 7788419..4e980a7 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -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);
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] at91ether: return PTR_ERR if call to clk_get fails
2012-09-20 7:04 [PATCH] at91ether: return PTR_ERR if call to clk_get fails Devendra Naga
@ 2012-09-20 7:42 ` Nicolas Ferre
2012-09-21 2:22 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Ferre @ 2012-09-20 7:42 UTC (permalink / raw)
To: Devendra Naga, netdev, David Miller; +Cc: linux-arm-kernel
On 09/20/2012 09:04 AM, Devendra Naga :
> 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>
Thanks,
> ---
> drivers/net/ethernet/cadence/at91_ether.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> index 7788419..4e980a7 100644
> --- a/drivers/net/ethernet/cadence/at91_ether.c
> +++ b/drivers/net/ethernet/cadence/at91_ether.c
> @@ -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);
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] at91ether: return PTR_ERR if call to clk_get fails
2012-09-20 7:42 ` Nicolas Ferre
@ 2012-09-21 2:22 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-09-21 2:22 UTC (permalink / raw)
To: nicolas.ferre; +Cc: devendra.aaru, netdev, linux-arm-kernel
From: Nicolas Ferre <nicolas.ferre@atmel.com>
Date: Thu, 20 Sep 2012 09:42:14 +0200
> On 09/20/2012 09:04 AM, Devendra Naga :
>> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-21 2:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20 7:04 [PATCH] at91ether: return PTR_ERR if call to clk_get fails Devendra Naga
2012-09-20 7:42 ` Nicolas Ferre
2012-09-21 2:22 ` David Miller
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).