From: Gabriele Mazzotta <gabriele.mzt@gmail.com>
To: jkosina@suse.cz
Cc: benjamin.tissoires@redhat.com, aduggan@synaptics.com,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Gabriele Mazzotta <gabriele.mzt@gmail.com>
Subject: [PATCH] HID: i2c-hid: Call device suspend callback before disabling irq
Date: Tue, 7 Jul 2015 21:58:02 +0200 [thread overview]
Message-ID: <1436299082-3526-1-git-send-email-gabriele.mzt@gmail.com> (raw)
The irq is most likely required by the suspend callback, so disable it
only after the callback had been executed.
Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
drivers/hid/i2c-hid/i2c-hid.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index f77469d..9ed69b5 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -1092,13 +1092,13 @@ static int i2c_hid_suspend(struct device *dev)
struct hid_device *hid = ihid->hid;
int ret = 0;
+ if (hid->driver && hid->driver->suspend)
+ ret = hid->driver->suspend(hid, PMSG_SUSPEND);
+
disable_irq(ihid->irq);
if (device_may_wakeup(&client->dev))
enable_irq_wake(ihid->irq);
- if (hid->driver && hid->driver->suspend)
- ret = hid->driver->suspend(hid, PMSG_SUSPEND);
-
/* Save some power */
i2c_hid_set_power(client, I2C_HID_PWR_SLEEP);
--
2.1.4
next reply other threads:[~2015-07-07 19:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 19:58 Gabriele Mazzotta [this message]
2015-07-07 20:34 ` [PATCH] HID: i2c-hid: Call device suspend callback before disabling irq Benjamin Tissoires
2015-07-07 20:49 ` Jiri Kosina
2015-07-08 10:24 ` Gabriele Mazzotta
2015-07-08 10:44 ` Jiri Kosina
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=1436299082-3526-1-git-send-email-gabriele.mzt@gmail.com \
--to=gabriele.mzt@gmail.com \
--cc=aduggan@synaptics.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).