public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: Saiyam Doshi <saiyamdoshi.in@gmail.com>
Cc: MSM <linux-arm-msm@vger.kernel.org>,
	I2C <linux-i2c@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Marc Zyngier <maz@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2 2/3] i2c: qup: Remove dev_err() log after platform_get_irq*() failure
Date: Wed, 18 Sep 2019 11:00:32 +0200	[thread overview]
Message-ID: <4e65aeeb-40da-7856-a22e-ce7aac21ae46@free.fr> (raw)
In-Reply-To: <20190917172120.GA11581@SD>

On 17/09/2019 19:21, Saiyam Doshi wrote:

> The debug message after platform_get_irq() failure is redundant
> because platform_get_irq() already prints an error. Thus remove it.
> 
> Generated by: scripts/coccinelle/api/platform_get_irq.cocci
> 
> Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com>
> ---
> Changes in v2:
> Updated changelog and removed unnecessary braces after if condition.
> 
>  drivers/i2c/busses/i2c-qup.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
> index 5519c19bfd9c..ed09a59066b2 100644
> --- a/drivers/i2c/busses/i2c-qup.c
> +++ b/drivers/i2c/busses/i2c-qup.c
> @@ -1766,10 +1766,8 @@ static int qup_i2c_probe(struct platform_device *pdev)
>  		return PTR_ERR(qup->base);
> 
>  	qup->irq = platform_get_irq(pdev, 0);
> -	if (qup->irq < 0) {
> -		dev_err(qup->dev, "No IRQ defined\n");
> +	if (qup->irq < 0)
>  		return qup->irq;
> -	}

As far as I understand, platform_get_irq() == 0 is also an error condition.

I think the typical way to handle this peculiarity is:
(Maybe the IRQ maintainers will correct me)

	qup->irq = platform_get_irq(pdev, 0);
	if (qup->irq <= 0)
		return qup->irq ? : -ENXIO;

Regards.

      reply	other threads:[~2019-09-18  9:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 17:21 [PATCH v2 2/3] i2c: qup: Remove dev_err() log after platform_get_irq*() failure Saiyam Doshi
2019-09-18  9:00 ` Marc Gonzalez [this message]

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=4e65aeeb-40da-7856-a22e-ce7aac21ae46@free.fr \
    --to=marc.w.gonzalez@free.fr \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=saiyamdoshi.in@gmail.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox