linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: i2c-hid: Call device suspend callback before disabling irq
@ 2015-07-07 19:58 Gabriele Mazzotta
  2015-07-07 20:34 ` Benjamin Tissoires
  2015-07-07 20:49 ` Jiri Kosina
  0 siblings, 2 replies; 5+ messages in thread
From: Gabriele Mazzotta @ 2015-07-07 19:58 UTC (permalink / raw)
  To: jkosina
  Cc: benjamin.tissoires, aduggan, linux-input, linux-kernel,
	Gabriele Mazzotta

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-08 10:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07 19:58 [PATCH] HID: i2c-hid: Call device suspend callback before disabling irq Gabriele Mazzotta
2015-07-07 20:34 ` Benjamin Tissoires
2015-07-07 20:49 ` Jiri Kosina
2015-07-08 10:24   ` Gabriele Mazzotta
2015-07-08 10:44     ` Jiri Kosina

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).