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=-10.1 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_GIT autolearn=unavailable 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 CE5A0C3F68F for ; Tue, 10 Dec 2019 22:42:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A41C324655 for ; Tue, 10 Dec 2019 22:42:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576017779; bh=B1QIwygrLOhokb6wIsVKv19GcVnKSWWMr+sjIqDHfZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Ws3aVSLTeZS3OF/aceWJf/RclzUq8bE0aMecDfpA5yG8ifeP1EbBPqHuGprb69kJ6 fmoofTbvSlkl1Smhelz9x34fiSZ4U1Om65hZZWiY5uGcTOmQDzPRWwY3eXRufVb0W9 PSN2C409fC17mWepVTCD2vMy2o2T0vdNnrnrZ7Uw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbfLJWbN (ORCPT ); Tue, 10 Dec 2019 17:31:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:51140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728107AbfLJWbM (ORCPT ); Tue, 10 Dec 2019 17:31:12 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2872B2073D; Tue, 10 Dec 2019 22:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576017071; bh=B1QIwygrLOhokb6wIsVKv19GcVnKSWWMr+sjIqDHfZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aS5ih6bHImVN+LpAodVrPU7Vwym2QLfb4LyusboWsVsnVzWORyhH+QZLeQO6SXC7W cetolBhGfhbBvDdqg9GFDlfEO9cK6sN36HLCAFfKJg9/yK5ziq52B/Ol/ySOFfESxy dg90+vgrJHKPaUnPuT3YTV7i0oejwU3oNcslU/nA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexandru Ardelean , Matt Ranostay , Jonathan Cameron , Sasha Levin , linux-iio@vger.kernel.org Subject: [PATCH AUTOSEL 4.9 30/91] iio: chemical: atlas-ph-sensor: fix iio_triggered_buffer_predisable() position Date: Tue, 10 Dec 2019 17:29:34 -0500 Message-Id: <20191210223035.14270-30-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191210223035.14270-1-sashal@kernel.org> References: <20191210223035.14270-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Alexandru Ardelean [ Upstream commit 0c8a6e72f3c04bfe92a64e5e0791bfe006aabe08 ] 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. Note this is not stable material. It's a fix in the logical model rather fixing an actual bug. These are being tidied up throughout the subsystem to allow more substantial rework that was blocked by variations in how things were done. Signed-off-by: Alexandru Ardelean Acked-by: Matt Ranostay Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- 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 dad2a8be68308..f5859c118a44a 100644 --- a/drivers/iio/chemical/atlas-ph-sensor.c +++ b/drivers/iio/chemical/atlas-ph-sensor.c @@ -331,16 +331,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