linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: ocores: Avoid false-positive error log message.
@ 2020-12-03 15:02 Stefan Lässer
  2020-12-03 15:20 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stefan Lässer @ 2020-12-03 15:02 UTC (permalink / raw)
  To: peter; +Cc: andrew, linux-i2c, Stefan Lässer

Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to
platform_get_irq*()"), platform_get_irq() will call dev_err() on an error.
In case of i2c ocores this leads to a false-positive error being logged:

[ 4.173989] 007: ocores-i2c ocores-i2c: IRQ index 0 not found

i2c ocores already handles the case when the IRQ cannot be found and
therefore there is no benefit in having this error message being logged.

This commit switches to platform_get_irq_optional(), which does not log
in case the IRQ cannot be found.

Signed-off-by: Stefan Lässer <stefan.laesser@omicronenergy.com>
---
 drivers/i2c/busses/i2c-ocores.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index a97cbaabd..273222e38 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -682,7 +682,7 @@ static int ocores_i2c_probe(struct platform_device *pdev)
 
 	init_waitqueue_head(&i2c->wait);
 
-	irq = platform_get_irq(pdev, 0);
+	irq = platform_get_irq_optional(pdev, 0);
 	/*
 	 * Since the SoC does have an interrupt, its DT has an interrupt
 	 * property - But this should be bypassed as the IRQ logic in this
-- 
2.25.1


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

* Re: [PATCH] i2c: ocores: Avoid false-positive error log message.
  2020-12-03 15:02 [PATCH] i2c: ocores: Avoid false-positive error log message Stefan Lässer
@ 2020-12-03 15:20 ` Andrew Lunn
  2020-12-03 17:19 ` Peter Korsgaard
  2020-12-03 20:16 ` Wolfram Sang
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2020-12-03 15:20 UTC (permalink / raw)
  To: Stefan Lässer; +Cc: peter, linux-i2c

On Thu, Dec 03, 2020 at 04:02:52PM +0100, Stefan Lässer wrote:
> Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to
> platform_get_irq*()"), platform_get_irq() will call dev_err() on an error.
> In case of i2c ocores this leads to a false-positive error being logged:
> 
> [ 4.173989] 007: ocores-i2c ocores-i2c: IRQ index 0 not found
> 
> i2c ocores already handles the case when the IRQ cannot be found and
> therefore there is no benefit in having this error message being logged.
> 
> This commit switches to platform_get_irq_optional(), which does not log
> in case the IRQ cannot be found.
> 
> Signed-off-by: Stefan Lässer <stefan.laesser@omicronenergy.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH] i2c: ocores: Avoid false-positive error log message.
  2020-12-03 15:02 [PATCH] i2c: ocores: Avoid false-positive error log message Stefan Lässer
  2020-12-03 15:20 ` Andrew Lunn
@ 2020-12-03 17:19 ` Peter Korsgaard
  2020-12-03 20:16 ` Wolfram Sang
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2020-12-03 17:19 UTC (permalink / raw)
  To: Stefan Lässer; +Cc: andrew, linux-i2c

>>>>> "Stefan" == Stefan Lässer <stefan.laesser@omicronenergy.com> writes:

 > Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to
 > platform_get_irq*()"), platform_get_irq() will call dev_err() on an error.
 > In case of i2c ocores this leads to a false-positive error being logged:

 > [ 4.173989] 007: ocores-i2c ocores-i2c: IRQ index 0 not found

 > i2c ocores already handles the case when the IRQ cannot be found and
 > therefore there is no benefit in having this error message being logged.

 > This commit switches to platform_get_irq_optional(), which does not log
 > in case the IRQ cannot be found.

 > Signed-off-by: Stefan Lässer <stefan.laesser@omicronenergy.com>

Reviewed-by: Peter Korsgaard <peter@korsgaard.com>

-- 
Bye, Peter Korsgaard

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

* Re: [PATCH] i2c: ocores: Avoid false-positive error log message.
  2020-12-03 15:02 [PATCH] i2c: ocores: Avoid false-positive error log message Stefan Lässer
  2020-12-03 15:20 ` Andrew Lunn
  2020-12-03 17:19 ` Peter Korsgaard
@ 2020-12-03 20:16 ` Wolfram Sang
  2020-12-03 20:20   ` Wolfram Sang
  2 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2020-12-03 20:16 UTC (permalink / raw)
  To: Stefan Lässer; +Cc: peter, andrew, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

On Thu, Dec 03, 2020 at 04:02:52PM +0100, Stefan Lässer wrote:
> Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to
> platform_get_irq*()"), platform_get_irq() will call dev_err() on an error.
> In case of i2c ocores this leads to a false-positive error being logged:
> 
> [ 4.173989] 007: ocores-i2c ocores-i2c: IRQ index 0 not found
> 
> i2c ocores already handles the case when the IRQ cannot be found and
> therefore there is no benefit in having this error message being logged.
> 
> This commit switches to platform_get_irq_optional(), which does not log
> in case the IRQ cannot be found.
> 
> Signed-off-by: Stefan Lässer <stefan.laesser@omicronenergy.com>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] i2c: ocores: Avoid false-positive error log message.
  2020-12-03 20:16 ` Wolfram Sang
@ 2020-12-03 20:20   ` Wolfram Sang
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2020-12-03 20:20 UTC (permalink / raw)
  To: Stefan Lässer, peter, andrew, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]


> > Signed-off-by: Stefan Lässer <stefan.laesser@omicronenergy.com>
> 
> Applied to for-current, thanks!

I meant for-next (because of a dependency), sorry for the noise.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2020-12-03 20:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03 15:02 [PATCH] i2c: ocores: Avoid false-positive error log message Stefan Lässer
2020-12-03 15:20 ` Andrew Lunn
2020-12-03 17:19 ` Peter Korsgaard
2020-12-03 20:16 ` Wolfram Sang
2020-12-03 20:20   ` Wolfram Sang

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).