From patchwork Mon Aug 25 13:53:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 1151 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 514A42F5313; Mon, 25 Aug 2025 13:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756130067; cv=none; b=SPYyCsHTR/02xS+PRhUTKOfldGgfS7wMWti/TFoFZnL426qHFgt5d4Opoib0Rd+owOLPGURV2XZukatR5v+ghjyNd3Cw194XUqsxWHcYvrH+oD+5MrD6O396u7+yNcLoMMoGP+2nr2/11zeM/fuapBgse5xR2I9uzmKNPQU7Hi8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756130067; c=relaxed/simple; bh=6Bf2gaUoJ/rpJT+iVrhH/BM4lvVMfQGSdzg8t4vEdKo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a78BIhEhaDOrKSc2TfMVq+DfTaLU+j8go6C+CdWsXPGeqOmXyea/7mvsFQhnUWTVjPzz0hVp4U0rQEO5GpQX44dKXrNCOz+Yf5FXznZ0DhtLI33ZeLdeoouylYfhplH9dSuxCj0ZhETKI64fKE5jTat2YO1TPo34CZ9+GM219bE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=S05fpzUL; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="S05fpzUL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1756130063; x=1787666063; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6Bf2gaUoJ/rpJT+iVrhH/BM4lvVMfQGSdzg8t4vEdKo=; b=S05fpzULMQTBk+6PNCZ2nZ9Ppp7mGgKR0onMILZnNK/pr+/g4xCjcST4 Fy+qO5FX/+/sX5fK+fzr9D1pBvqo60oby2+RGZoTolva69cEUW77B66kX rdX2rUBiDVmVgkazJ/APHb3phpcmUljOAnOinkacNUXEu4OrQT3BGWfKg prO9ioO/xwWp1y7K/WblTgioCYkg2DXnSABeVn06kfkxGW5maTZ3UwsBH d18DBLGP8x5I2Vq4doZI02+YD43X792In/d34yvNBh9WR+DijLRmjs0tv TDfKJ7lNGdEfsIYUxTFVyUw3zO7Xo29J3FcW/E50N4A04iqQOvS66RAnG w==; X-CSE-ConnectionGUID: +oEQm/PaRqugs2DchbIGMA== X-CSE-MsgGUID: 1Wb3y1nRSmewf0hHEP386A== X-IronPort-AV: E=McAfee;i="6800,10657,11533"; a="68936601" X-IronPort-AV: E=Sophos;i="6.18,213,1751266800"; d="scan'208";a="68936601" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2025 06:54:21 -0700 X-CSE-ConnectionGUID: +vFyAZ6jRtyGQ0x7pYL4XQ== X-CSE-MsgGUID: FpML6g6XTFOoa7EH4J0I1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,213,1751266800"; d="scan'208";a="174583467" Received: from vpanait-mobl.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.245.7]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2025 06:54:11 -0700 Received: from punajuuri.localdomain (unknown [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id C250F121F6E; Mon, 25 Aug 2025 16:54:01 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.98.2) (envelope-from ) id 1uqXe5-00000007POI-3BxM; Mon, 25 Aug 2025 16:54:01 +0300 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , 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?q?Jo=C3=A3o_Paulo_Gon?= =?utf-8?q?=C3=A7alves?= , Rui Miguel Silva , Jean-Baptiste Maneyrol , Subhajit Ghosh , Gerald Loacker , Andreas Klinger , Crt Mori , Waqar Hameed , Julien Stephan , Peter Zijlstra , Sakari Ailus , 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 , =?utf-8?q?Uwe_Kleine-K=C3=B6?= =?utf-8?q?nig?= , 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 Cc: 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: [PATCH v3 05/12] iio: dac: Remove redundant pm_runtime_mark_last_busy() calls Date: Mon, 25 Aug 2025 16:53:54 +0300 Message-ID: <20250825135401.1765847-6-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250825135401.1765847-1-sakari.ailus@linux.intel.com> References: <20250825135401.1765847-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Status: O 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 clean up error handling in stm32_dac_set_enable_state(). Signed-off-by: Sakari Ailus --- drivers/iio/dac/stm32-dac.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/iio/dac/stm32-dac.c b/drivers/iio/dac/stm32-dac.c index 344388338d9b..e8688f9d6df7 100644 --- a/drivers/iio/dac/stm32-dac.c +++ b/drivers/iio/dac/stm32-dac.c @@ -82,9 +82,9 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, ret = regmap_update_bits(dac->common->regmap, STM32_DAC_CR, msk, en); mutex_unlock(&dac->lock); - if (ret < 0) { + if (ret) { dev_err(&indio_dev->dev, "%s failed\n", str_enable_disable(en)); - goto err_put_pm; + goto err_pm_put; } /* @@ -95,18 +95,8 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch, if (en && dac->common->hfsel) udelay(1); - if (!enable) { - pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); - } - - return 0; - -err_put_pm: - if (enable) { - pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); - } +err_pm_put: + pm_runtime_put_autosuspend(dev); return ret; } @@ -349,7 +339,6 @@ static int stm32_dac_probe(struct platform_device *pdev) if (ret) goto err_pm_put; - pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); return 0;