linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/3] i2c: qup: Remove dev_err() log after platform_get_irq*() failure
@ 2019-09-17 17:21 Saiyam Doshi
  2019-09-18  9:00 ` Marc Gonzalez
  0 siblings, 1 reply; 2+ messages in thread
From: Saiyam Doshi @ 2019-09-17 17:21 UTC (permalink / raw)
  To: agross; +Cc: linux-arm-msm, linux-i2c, linux-kernel, markus.elfring

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;
-	}

 	if (has_acpi_companion(qup->dev)) {
 		ret = device_property_read_u32(qup->dev,
--
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 2/3] i2c: qup: Remove dev_err() log after platform_get_irq*() failure
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Gonzalez @ 2019-09-18  9:00 UTC (permalink / raw)
  To: Saiyam Doshi; +Cc: MSM, I2C, LKML, Marc Zyngier, Thomas Gleixner

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-18  9:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).