From: "Nuno Sá" <noname.nuno@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Michael Hennerich <michael.hennerich@analog.com>,
Nuno Sa <nuno.sa@analog.com>
Cc: Utsav Agarwal <utsav.agarwal@analog.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: adp5588-keys - do not try to disable interrupt 0
Date: Mon, 07 Oct 2024 08:27:28 +0200 [thread overview]
Message-ID: <6cd859e9f307c9358d81e5d8d7856496d8c69b6b.camel@gmail.com> (raw)
In-Reply-To: <Zv_2jEMYSWDw2gKs@google.com>
On Fri, 2024-10-04 at 07:07 -0700, Dmitry Torokhov wrote:
> 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")
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> drivers/input/keyboard/adp5588-keys.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/keyboard/adp5588-keys.c
> b/drivers/input/keyboard/adp5588-keys.c
> index d25d63a807f2..dc734974ce06 100644
> --- a/drivers/input/keyboard/adp5588-keys.c
> +++ b/drivers/input/keyboard/adp5588-keys.c
> @@ -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;
> }
> --
> 2.47.0.rc0.187.ge670bccf7e-goog
>
>
prev parent reply other threads:[~2024-10-07 6:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 14:07 [PATCH] Input: adp5588-keys - do not try to disable interrupt 0 Dmitry Torokhov
2024-10-07 6:27 ` Nuno Sá [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6cd859e9f307c9358d81e5d8d7856496d8c69b6b.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=nuno.sa@analog.com \
--cc=utsav.agarwal@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).