All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] at91ether: return PTR_ERR if call to clk_get fails
Date: Thu, 20 Sep 2012 09:42:14 +0200	[thread overview]
Message-ID: <505AC8D6.5080404@atmel.com> (raw)
In-Reply-To: <1348124676-6627-1-git-send-email-devendra.aaru@gmail.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Devendra Naga <devendra.aaru@gmail.com>, <netdev@vger.kernel.org>,
	"David Miller" <davem@davemloft.net>
Cc: linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] at91ether: return PTR_ERR if call to clk_get fails
Date: Thu, 20 Sep 2012 09:42:14 +0200	[thread overview]
Message-ID: <505AC8D6.5080404@atmel.com> (raw)
In-Reply-To: <1348124676-6627-1-git-send-email-devendra.aaru@gmail.com>

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

  reply	other threads:[~2012-09-20  7:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2012-09-20  7:42   ` Nicolas Ferre
2012-09-21  2:22   ` David Miller
2012-09-21  2:22     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505AC8D6.5080404@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.