From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 107D9C4360C for ; Sun, 6 Oct 2019 09:27:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D974820867 for ; Sun, 6 Oct 2019 09:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570354052; bh=HqEXAYIgyXLmOdsdRNKQRbfLSC1uipoNQvtZW0Er9V0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=R0p6yUXZOvPLMWsnPf4SgUL5rUQduedzCZLn9NbzSzV7HHDxc4BSxbJU4ZjvSSIaT cD2GU5KqRcfv1/npGQa6GwWIggfZiOneyLugfmNAtywzITBqPKrYVGr+B5Yk43oyUv 88UK5vIlvzGdFHZM3P6SPG6SsWC3BS4LIcdMrohY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726224AbfJFJ1c (ORCPT ); Sun, 6 Oct 2019 05:27:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:54030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfJFJ1c (ORCPT ); Sun, 6 Oct 2019 05:27:32 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 551D720700; Sun, 6 Oct 2019 09:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570354051; bh=HqEXAYIgyXLmOdsdRNKQRbfLSC1uipoNQvtZW0Er9V0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BAO1KptAz7LThMOv5lrDT6f3ujq1VxfuvbJxSKFpu1nkt2Lx/lpF/iBkDHqIbJe5Q WOK1GRxkPMoUOOliHtaIsMjoCd7HHyhj9c1ePEoiHrmhgxLhrscnpy3BA2+H7KlI4l u96ypleyNdG05jlqmG0oNaVEfL+fS9+z2x/dB3mI= Date: Sun, 6 Oct 2019 10:27:27 +0100 From: Jonathan Cameron To: Matt Ranostay Cc: Alexandru Ardelean , "open list:IIO SUBSYSTEM AND DRIVERS" , Peter Meerwald-Stadler , Hartmut Knaack Subject: Re: [PATCH] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position Message-ID: <20191006102727.6945a271@archlinux> In-Reply-To: References: <20190920073122.21713-1-alexandru.ardelean@analog.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Sat, 5 Oct 2019 18:56:48 -0700 Matt Ranostay wrote: > On Fri, Sep 20, 2019 at 12:31 AM Alexandru Ardelean > wrote: > > > > The iio_triggered_buffer_{predisable,postenable} functions attach/detach > > the poll functions. > > > > The iio_triggered_buffer_predisable() should be called last, to detach the > > poll func after the devices has been suspended. > > > > The position of iio_triggered_buffer_postenable() is correct. > > > > Signed-off-by: Alexandru Ardelean > > Sorry didn't notice this till now. Looks good to me. > > Acked-by: Matt Ranostay Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > > > --- > > drivers/iio/chemical/atlas-ph-sensor.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c > > index 3a20cb5d9bff..6c175eb1c7a7 100644 > > --- a/drivers/iio/chemical/atlas-ph-sensor.c > > +++ b/drivers/iio/chemical/atlas-ph-sensor.c > > @@ -323,16 +323,16 @@ static int atlas_buffer_predisable(struct iio_dev *indio_dev) > > struct atlas_data *data = iio_priv(indio_dev); > > int ret; > > > > - ret = iio_triggered_buffer_predisable(indio_dev); > > + ret = atlas_set_interrupt(data, false); > > if (ret) > > return ret; > > > > - ret = atlas_set_interrupt(data, false); > > + pm_runtime_mark_last_busy(&data->client->dev); > > + ret = pm_runtime_put_autosuspend(&data->client->dev); > > if (ret) > > return ret; > > > > - pm_runtime_mark_last_busy(&data->client->dev); > > - return pm_runtime_put_autosuspend(&data->client->dev); > > + return iio_triggered_buffer_predisable(indio_dev); > > } > > > > static const struct iio_trigger_ops atlas_interrupt_trigger_ops = { > > -- > > 2.20.1 > >