diff mbox series

gpio: pca953x: suppress interrupts warning when not applicable

Message ID d0ffac0745a745316242b0bf06f53aeb02cd6582.1529588326.git.baruch@tkos.co.il
State New
Headers show
Series gpio: pca953x: suppress interrupts warning when not applicable | expand

Commit Message

Baruch Siach June 21, 2018, 1:38 p.m. UTC
Don't warn about missing interrupts support when the parent interrupt is
not defined. Enabling interrupts support would not make it work anyway.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/gpio/gpio-pca953x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij June 29, 2018, 9:11 a.m. UTC | #1
On Thu, Jun 21, 2018 at 3:38 PM Baruch Siach <baruch@tkos.co.il> wrote:

> Don't warn about missing interrupts support when the parent interrupt is
> not defined. Enabling interrupts support would not make it work anyway.
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Would be great to get some review from Andy and/or H. Nikolaus before
applying this patch.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Shevchenko June 29, 2018, 3:48 p.m. UTC | #2
On Fri, 2018-06-29 at 11:11 +0200, Linus Walleij wrote:
> On Thu, Jun 21, 2018 at 3:38 PM Baruch Siach <baruch@tkos.co.il>
> wrote:
> 
> > Don't warn about missing interrupts support when the parent
> > interrupt is
> > not defined. Enabling interrupts support would not make it work
> > anyway.
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> 
> Would be great to get some review from Andy and/or H. Nikolaus before
> applying this patch.

If I read that patch correctly and the GPIO expander which _can_
generate interrupt has no INT line connected, the change makes sense to
me.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index c55ad157e820..023a32cfac42 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -708,7 +708,7 @@  static int pca953x_irq_setup(struct pca953x_chip *chip,
 {
 	struct i2c_client *client = chip->client;
 
-	if (irq_base != -1 && (chip->driver_data & PCA_INT))
+	if (client->irq && irq_base != -1 && (chip->driver_data & PCA_INT))
 		dev_warn(&client->dev, "interrupt support not compiled in\n");
 
 	return 0;