Skip to content

Commit 2860586

Browse files
committed
Input: adp5588-keys - do not try to disable interrupt 0
Commit dc74881 ("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: dc74881 ("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>
1 parent bffdf9d commit 2860586

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/input/keyboard/adp5588-keys.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,8 @@ static int adp5588_suspend(struct device *dev)
822822
{
823823
struct i2c_client *client = to_i2c_client(dev);
824824

825-
disable_irq(client->irq);
825+
if (client->irq)
826+
disable_irq(client->irq);
826827

827828
return 0;
828829
}
@@ -831,7 +832,8 @@ static int adp5588_resume(struct device *dev)
831832
{
832833
struct i2c_client *client = to_i2c_client(dev);
833834

834-
enable_irq(client->irq);
835+
if (client->irq)
836+
enable_irq(client->irq);
835837

836838
return 0;
837839
}

0 commit comments

Comments
 (0)