Skip to contentSkip to conversation

i2c: ocores: Avoid false-positive error log message.

PATCH Applied Stefan Lässer 4 participants 5 messages Dec 3, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: ocores: Avoid false-positive error log message.

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.

---
 drivers/i2c/busses/i2c-ocores.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-ocores.c +1 -1
index a97cbaabd..273222e38 100644
@@ -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
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · 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
Quoted 7 lines

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.

Andrew

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Stefan Lässer
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Stefan" == Stefan Lässer <[email protected]> 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
Quoted 7 lines

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.

Signature · 1 line
Bye, Peter Korsgaard
Applied
#3 lore raw
In reply to Stefan Lässer
Quoted 6 lines · 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
Quoted 7 lines

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.

Applied to for-current, thanks!