i2c: ocores: Avoid false-positive error log message.
authorStefan Lässer <stefan.laesser@omicronenergy.com>
Thu, 3 Dec 2020 15:02:52 +0000 (16:02 +0100)
committerWolfram Sang <wsa@kernel.org>
Thu, 3 Dec 2020 20:18:16 +0000 (21:18 +0100)
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>
Reviewed-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-ocores.c

index a97cbaabd308e61a1cf33e2e233cd23ab419fced..273222e38056edda2d89aea155cbef9c1232ba97 100644 (file)
@@ -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