]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Input: adp5588-keys - do not try to disable interrupt 0
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 4 Oct 2024 14:07:08 +0000 (07:07 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 25 Oct 2024 22:52:45 +0000 (15:52 -0700)
Commit dc748812fca0 ("Input: adp5588-keys - add support for pure gpio")
made having interrupt line optional for the device, however it neglected
to update suspend and resume handlers that try to disable interrupts
for the duration of suspend.

Fix this by checking if interrupt number assigned to the i2c device is
not 0 before trying to disable or reenable it.

Fixes: dc748812fca0 ("Input: adp5588-keys - add support for pure gpio")
Link: https://lore.kernel.org/r/Zv_2jEMYSWDw2gKs@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/adp5588-keys.c

index d25d63a807f230a6b783a9364fc37dd0d71c8204..dc734974ce0687a6e850242b531979be8395b394 100644 (file)
@@ -822,7 +822,8 @@ static int adp5588_suspend(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
 
-       disable_irq(client->irq);
+       if (client->irq)
+               disable_irq(client->irq);
 
        return 0;
 }
@@ -831,7 +832,8 @@ static int adp5588_resume(struct device *dev)
 {
        struct i2c_client *client = to_i2c_client(dev);
 
-       enable_irq(client->irq);
+       if (client->irq)
+               enable_irq(client->irq);
 
        return 0;
 }