Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933251AbbGGUem (ORCPT ); Tue, 7 Jul 2015 16:34:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37161 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932713AbbGGUef (ORCPT ); Tue, 7 Jul 2015 16:34:35 -0400 Date: Tue, 7 Jul 2015 16:34:32 -0400 From: Benjamin Tissoires To: Gabriele Mazzotta Cc: jkosina@suse.cz, aduggan@synaptics.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: i2c-hid: Call device suspend callback before disabling irq Message-ID: <20150707203432.GL18484@mail.corp.redhat.com> References: <1436299082-3526-1-git-send-email-gabriele.mzt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1436299082-3526-1-git-send-email-gabriele.mzt@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1424 Lines: 46 On Jul 07 2015 or thereabouts, Gabriele Mazzotta wrote: > 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 > --- Just in case Jiri missed it: Reviewed-by: Benjamin Tissoires Thanks! Benjamin > 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 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/