From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD29917BA9; Mon, 25 Aug 2025 15:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756134982; cv=none; b=YfuCGPcoqwIQoiv827wtmirwJLFzJ1lLFiF23hQKQG4LPD7D2N//FWLhZ66gEjEcC+KSOndhm+1Ljw+bg+sfR4V3QHR3kFfo+4Kr4uqkW1RdLjKOSu/Puh79yVurFrjr7cA23oeW4eqn48H1/wFSlBmO3SBiHxGzhyRJojH3LF0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756134982; c=relaxed/simple; bh=ksZo7O/an1egh++NqqPXMDhaLDy/S33PXrwPNp3MOqY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=V9n5aJYbbCPw798NpcL+e3PNQOIXYU4FrlzMElg+8GqalPWLrycO7a1X476Q7a3SSVFRRUxJ4HApG6Lh2GNRfYY0U3uq3sCLaw7yj8b7SN1JnzUHE1pjg8KKm2pdOpo3fP9ZaCOkA5MV/YWjKq35VSRa78hZDmFXz/g9FqaWZA8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rRFES+Kt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rRFES+Kt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2ADEC4CEED; Mon, 25 Aug 2025 15:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756134981; bh=ksZo7O/an1egh++NqqPXMDhaLDy/S33PXrwPNp3MOqY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rRFES+Ktw15O9XiztMF+h5Ctk8J+tgDGriguGscvOgMkpP3xu6yBEm3LWCmuU94T1 MbRDUU5ADf/JMaIpqI3l0pkcEM0JoB3/cDA44R3DFNGGR5VQVTTEeShD4qV/CQE3cH mNqtElV+9S4LbJyBfpsz4s/9BzU1aE7bx8H3SZ1WpRI28CZE8qShhrrwqPKGLUwDKT e6Qe6SQcamXATW7mDhkwQY2h+/fFW9vjI3Q7FL9Yq2K5QBzepGznkQeFjGMHY6kJl3 HQ32NjopO8g4ti6oxIAD5MTPbNFO6NcBBHDrqKE8o4lfnkMZKQSJDsyVw1cl85O6CN qzydW110cddSQ== Date: Mon, 25 Aug 2025 16:15:52 +0100 From: Jonathan Cameron To: Sakari Ailus Cc: David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , Linus Walleij , Eugen Hristev , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Cai Huoqing , Haibo Chen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Marek Vasut , Geert Uytterhoeven , Magnus Damm , Lad Prabhakar , Maxime Coquelin , Alexandre Torgue , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Francesco Dolcini , =?UTF-8?B?Sm/Do28=?= Paulo =?UTF-8?B?R29uw6dhbHZlcw==?= , Rui Miguel Silva , Jean-Baptiste Maneyrol , Subhajit Ghosh , Gerald Loacker , Andreas Klinger , Crt Mori , Waqar Hameed , Julien Stephan , Peter Zijlstra , Greg KH , Bo Liu , Al Viro , Sean Nyekjaer , Frank Li , Han Xu , Rayyan Ansari , Gustavo Vaz , Matti Vaittinen , Alexandru Ardelean , "Jiri Slaby (SUSE)" , "Rob Herring (Arm)" , Fabrice Gasnier , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , Olivier Moysan , Christophe JAILLET , Marcelo Schmitt , Vasileios Amoiridis , Srinivas Pandruvada , Hans de Goede , Javier Carrasco , Abhash Jha , chuguangqing , Shreeya Patel , Per-Daniel Olsson , =?UTF-8?B?QmFybmFiw6FzIEN6?= =?UTF-8?B?w6ltw6Fu?= , Neil Armstrong , David Laight , Jakob Hauser , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linux.dev Subject: Re: [PATCH v3 09/12] iio: magnetometer: Remove redundant pm_runtime_mark_last_busy() calls Message-ID: <20250825161552.69b6e5a3@jic23-huawei> In-Reply-To: <20250825135401.1765847-10-sakari.ailus@linux.intel.com> References: <20250825135401.1765847-1-sakari.ailus@linux.intel.com> <20250825135401.1765847-10-sakari.ailus@linux.intel.com> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.50; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 25 Aug 2025 16:53:58 +0300 Sakari Ailus wrote: > pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(), > pm_runtime_autosuspend() and pm_request_autosuspend() now include a call > to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to > pm_runtime_mark_last_busy(). > > Also drop checking for errors on pm_runtime_put_autosuspend() in > bmc150_magn_set_power_state(). > > Signed-off-by: Sakari Ailus > Reviewed-by: Linus Walleij One comment inline, but similar to the light sensors, I think it still makes sense to take this patch now. Applied Thanks, Jonathan > diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c > index 761daead5ada..6a73f6e2f1f0 100644 > --- a/drivers/iio/magnetometer/bmc150_magn.c > +++ b/drivers/iio/magnetometer/bmc150_magn.c > @@ -257,22 +257,17 @@ static int bmc150_magn_set_power_mode(struct bmc150_magn_data *data, > > static int bmc150_magn_set_power_state(struct bmc150_magn_data *data, bool on) > { This is another 'helper' that should probably go away in the longer term. > -#ifdef CONFIG_PM > - int ret; > + int ret = 0; > > - if (on) { > + if (on) > ret = pm_runtime_resume_and_get(data->dev); > - } else { > - pm_runtime_mark_last_busy(data->dev); > - ret = pm_runtime_put_autosuspend(data->dev); > - } > - > + else > + pm_runtime_put_autosuspend(data->dev); > if (ret < 0) { > dev_err(data->dev, > "failed to change power state to %d\n", on); > return ret; > } > -#endif > > return 0; > }