All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Ruan Jinjie <ruanjinjie@huawei.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, wei.fang@nxp.com, robh@kernel.org,
	bhupesh.sharma@linaro.org, arnd@arndb.de, netdev@vger.kernel.org,
	Alex Elder <elder@linaro.org>
Subject: Re: [PATCH net-next] cirrus: cs89x0: fix the return value handle and remove redundant dev_warn() for platform_get_irq()
Date: Wed, 2 Aug 2023 10:32:12 +0200	[thread overview]
Message-ID: <ZMoUjMGxhUZ9v2pT@kernel.org> (raw)
In-Reply-To: <20230801133121.416319-1-ruanjinjie@huawei.com>

+ Alex Elder

On Tue, Aug 01, 2023 at 09:31:21PM +0800, Ruan Jinjie wrote:
> There is no possible for platform_get_irq() to return 0
> and the return value of platform_get_irq() is more sensible
> to show the error reason.
> 
> And there is no need to call the dev_warn() function directly to print
> a custom message when handling an error from platform_get_irq() function as
> it is going to display an appropriate error message in case of a failure.
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>

Reviewed-by: Simon Horman <horms@kernel.org>

> ---
>  drivers/net/ethernet/cirrus/cs89x0.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
> index 7c51fd9fc9be..d323c5c23521 100644
> --- a/drivers/net/ethernet/cirrus/cs89x0.c
> +++ b/drivers/net/ethernet/cirrus/cs89x0.c
> @@ -1854,9 +1854,8 @@ static int __init cs89x0_platform_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	dev->irq = platform_get_irq(pdev, 0);
> -	if (dev->irq <= 0) {
> -		dev_warn(&dev->dev, "interrupt resource missing\n");
> -		err = -ENXIO;
> +	if (dev->irq < 0) {
> +		err = dev->irq;
>  		goto free;
>  	}
>  
> -- 
> 2.34.1
> 
> 

  reply	other threads:[~2023-08-02  8:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 13:31 [PATCH net-next] cirrus: cs89x0: fix the return value handle and remove redundant dev_warn() for platform_get_irq() Ruan Jinjie
2023-08-02  8:32 ` Simon Horman [this message]
2023-08-02 13:33   ` Alex Elder
2023-08-02 20:12     ` Arnd Bergmann
2023-08-02 19:20 ` patchwork-bot+netdevbpf

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=ZMoUjMGxhUZ9v2pT@kernel.org \
    --to=horms@kernel.org \
    --cc=arnd@arndb.de \
    --cc=bhupesh.sharma@linaro.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=elder@linaro.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=wei.fang@nxp.com \
    /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.