From nobody Sun Oct 5 07:20:26 2025 Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11013005.outbound.protection.outlook.com [52.101.72.5]) (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 BDA324A0C; Thu, 7 Aug 2025 13:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.72.5 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754572874; cv=fail; b=aoAHK30HI9C0RIu5qUNPq6ZFxl3uvkj4XIdUb8wdwTnGUnqwYDUmP2t6+eP1uatEmIiMjrWZFbgKOxcc0DPBBvM2t/miYHAG8QN/FhbhC7OzeKETqZmkfDdXi15ROI4e6Rhaj8t2+MxDzUZd0E7KFkVvyNA+aATNE5K30WNFi74= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754572874; c=relaxed/simple; bh=jY3onvjXhlOQnypq3SjqmmiVIKeCC4R3gmmxTzDfGMs=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=e52ZSIa/mTSdP0DHkeS72LpllwrxOdyS/g/hD8hFUhcfZnCv3o+W1NURw7mR/ciAOGE3rax0UAjPit8yufggVSIO5d3sZ8j1CHmL69J/HMYPVsZC5DqYDoz6zAHp4CI7flAXOIlqKOWmKUMEEOoa8CilES1houAoLHJY6JeMnrw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com; spf=pass smtp.mailfrom=axis.com; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b=XQk1aKQh; arc=fail smtp.client-ip=52.101.72.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=axis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b="XQk1aKQh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RQqetpgNQczI4b0NA4KFTiOD8/TSRff6eEqLJMwRqP7zT1HvE0vi+b2AFTaTLl5y4RkemduEozLrG/EitpZ9ErYzK4JTenTF/MPgYrU/DrfnaupYyF46HlXg1wP0cXuhr4N3v/WiQPEAdN7jV6TcHI9NjGdw1SQtUH2niaVEZ8wTHm9VupeszNV5RpkwM9sRnEhPvj2ZTmnLeV34S++ycPAFSVERjBK1I5WGc3YPHufhc030FZ3gvsYeolmZwB2cjSpmAti2w0k+Es3aG75YbbIZoaQX//gGLIlO8TsUiX2osPVu8hoLpWtbvtpKuRrC6inEicnFIqW6HtRkPwR6aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=n4B+DuRdNoT6o8X0sV8dOh00GPR3turbXYwOseGQPak=; b=B1GT66J57S7Iq61eMDFktWudiwX94cBq6YRbirWhZ+9IKpP67ptRjbXv689HhGiSqGGD1vRw0QomvL8AbMIr3iIY0l+3br0r5mVl/w5JUhrRJTP90NQq1rH0UEqsELsiFx05jbQHCjolP3o8o3R97Wtwjiw0P9l0AVwKj8OYiBzTdZNxk6ky6mXnxbKZxispcZ8tEEWNR7XqMbbP5onhVV/cZIvN+CkdX9zSVBpkOz8v+X7nUbPcIrIz7Vnwm9yqaa0R/H5FTPIOGQxHQN8Vx+P9vA51MXSX1P0FoLojry1FIV4TwDtGxZPm8f6/PywY+pAoBwHJa1+ow57B0nN65w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n4B+DuRdNoT6o8X0sV8dOh00GPR3turbXYwOseGQPak=; b=XQk1aKQhuYn2VnkMZhW2GMT1MFPxFIrbemN0D4IcE/6ZMQ+B0KQMGzeS4PybfZ7PgF/C1NdXCr0rFyjeaCi3w+/uteBPi8OvIDyvXMDLe62DrO3KQ70VLiNz8PQi94T6U36at/qEcbFpye8AcJJFkrVzByhpyB78ePUCkde36eI= Received: from DUZPR01CA0342.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b8::26) by AS8PR02MB9090.eurprd02.prod.outlook.com (2603:10a6:20b:5b8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.16; Thu, 7 Aug 2025 13:21:09 +0000 Received: from DB1PEPF000509F0.eurprd03.prod.outlook.com (2603:10a6:10:4b8:cafe::cb) by DUZPR01CA0342.outlook.office365.com (2603:10a6:10:4b8::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9009.16 via Frontend Transport; Thu, 7 Aug 2025 13:21:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB1PEPF000509F0.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9009.8 via Frontend Transport; Thu, 7 Aug 2025 13:21:09 +0000 Received: from pc52311-2249 (10.4.0.13) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Thu, 7 Aug 2025 15:21:08 +0200 From: Waqar Hameed To: Vignesh Raghavendra , Julien Panis , William Breathitt Gray , Andrew Davis CC: , , , Subject: [PATCH v3] counter: ti-ecap-capture: Use devm_pm_runtime_enable() User-Agent: a.out Date: Thu, 7 Aug 2025 15:21:08 +0200 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: se-mail02w.axis.com (10.20.40.8) To se-mail01w.axis.com (10.20.40.7) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F0:EE_|AS8PR02MB9090:EE_ X-MS-Office365-Filtering-Correlation-Id: f68ce342-411f-45f7-2505-08ddd5b545bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?PrsObfwO0QGbnWoK2GSU+2+CddNH/iT76vVxHfHyrutLGFD2P7SSP5g8t73t?= =?us-ascii?Q?eeWehHgYabypzp+2DfXM5+OWHOCeYn9KBe/K35XyVD1YqhGnbnfeZS5KiOq5?= =?us-ascii?Q?yHuV1eYbsip2CCiSZZfzG6dvmbuZiQ169PvCFN9Cb/exfKsx1WbuT4gJXuxu?= =?us-ascii?Q?LpeeFc/bgOkhJdp4O7Q3jpdxOFQZoVVxG1zCioytGmBKB9sF70Mx7nXoPVx1?= =?us-ascii?Q?Y5Pmuv0r561MFf0PI6PSJdwi1dVRyq7x0EUe5X9O8zPxjJHceYz5T4dh7LMB?= =?us-ascii?Q?MUE7kY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srJF1qxn9dgOypSH5DQlR?= =?us-ascii?Q?uHQRNXYJI1QHc9oFiU8Hly/1oJJxXlyQWmLbp8ZwX8GdTroi1HY/c3hAKTUo?= =?us-ascii?Q?1T9a+y+0FQCYQcDUUgNWueQ0YlMbvf61M7Ti2WyTVyW9jMfA22JaVfIQFPX0?= =?us-ascii?Q?+S/RFEkXYoZL4vVUdmw9BAbyPgONhtvXJ6xd/iE5DPHiabLTaud7xc6eF+V6?= =?us-ascii?Q?5H7C2+NEt5/sIonZNNBYbRAVrgbV/48v0QCLFyNdDX9Sj1QrSeLFvr0UgCLJ?= =?us-ascii?Q?MSQGQnoAgZfsR7AOmLcOQG4MoNhtvmQrANkJWXwRoESL7ijPnBHMCIp5NLss?= =?us-ascii?Q?lgviwtHC01UTYqnx3NJIyi5B/FCmXB5NY0gD8t+RsuG2pv5AAUzzmsJO3A?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:195.60.68.100;CTRY:SE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.axis.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2025 13:21:09.1643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f68ce342-411f-45f7-2505-08ddd5b545bb X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af;Ip=[195.60.68.100];Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509F0.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR02MB9090 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is no need to register a manual `devm` action for `pm_runtime_disable()` when `devm_pm_runtime_enable()` exists. It does the same thing (but also calls `pm_runtime_dont_use_autosuspend()`, which should be fine here). Moreover, when `devm_add_action_or_reset()` fails, it is due to a failed memory allocation and will thus return `-ENOMEM`. `dev_err_probe()` doesn't do anything when error is `-ENOMEM`. Therefore, the call to `dev_err_probe()` is useless. Note that `devm_pm_runtime_enable()` has a tail call to `devm_add_action_or_reset()` and thus returns that value. Therefore, replace `dev_err_probe()` with the returning value. Signed-off-by: Waqar Hameed Acked-by: Andrew Davis --- Changes in v3: * Remove the manual `devm_add_action_or_reset()` and use `devm_pm_runtime_enable()` instead. =20 Link to v2: https://lore.kernel.org/lkml/pndms8em7tf.a.out@axis.com/ Changes in v2: * Split the patch to one seperate patch for each sub-system. Link to v1: https://lore.kernel.org/all/pnd7c0s6ji2.fsf@axis.com/ drivers/counter/ti-ecap-capture.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-ca= pture.c index 3faaf7f60539..3586a7ab9887 100644 --- a/drivers/counter/ti-ecap-capture.c +++ b/drivers/counter/ti-ecap-capture.c @@ -465,11 +465,6 @@ static irqreturn_t ecap_cnt_isr(int irq, void *dev_id) return IRQ_HANDLED; } =20 -static void ecap_cnt_pm_disable(void *dev) -{ - pm_runtime_disable(dev); -} - static int ecap_cnt_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -523,12 +518,9 @@ static int ecap_cnt_probe(struct platform_device *pdev) =20 platform_set_drvdata(pdev, counter_dev); =20 - pm_runtime_enable(dev); - - /* Register a cleanup callback to care for disabling PM */ - ret =3D devm_add_action_or_reset(dev, ecap_cnt_pm_disable, dev); + ret =3D devm_pm_runtime_enable(dev); if (ret) - return dev_err_probe(dev, ret, "failed to add pm disable action\n"); + return ret; =20 ret =3D devm_counter_add(dev, counter_dev); if (ret) base-commit: 260f6f4fda93c8485c8037865c941b42b9cba5d2 --=20 2.39.5