From patchwork Fri Jan 3 08:41:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 854984 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013039.outbound.protection.outlook.com [52.101.67.39]) (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 7F3EC1CDA2E; Fri, 3 Jan 2025 08:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.39 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893729; cv=fail; b=PJ/1zqBn0vMiW4jabA4z2FEeAcNBFEhiMjh2akMZW3m7xKcFrDwcOj4xuwqwXZ6j/b9MfH1+SXtYtpgudpF0/Atp0dUsIyiNDKPhy0FY49Gj4pmRQjjiY9yw4Xs4sJjzEM8lPY6ZBiQnPO3E8tHJp5f3ddROvVe91CBdvlRXdqw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893729; c=relaxed/simple; bh=MtlGyF7f4IaQ5gXyjDyNBKstfyPBC/6xufVjFPOKlIQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=tq0SK/wdk++ZzMWBCHExITQKMq2AqBPPtiSsHYfnPXuWLyzbLzFbNqRIoRXeSCjdDlmshtYI1NiY/Tm5DM0bf73TWl28D6b7wrd/UEIzBlNhEgjgrGGdzia1MOL/jcqarHrfUzwaq+miek8kjhC+xlPy0S0rkoyWifeRUOdv87c= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=SQQbuU/P; arc=fail smtp.client-ip=52.101.67.39 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="SQQbuU/P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HIZYJBv1zHodPoR8UlsPvIFTyC734gJepvyWTq2DPyHmKVGqauYz5yNbfVLOJdiYkl/XoD8uZnXZWiriXMiDpiJDIDoZ29kOVXO9sfxr/WDKzlPuP69NUY37ADt0PPBv/wk3ygrQUB1lVZelYNgUHL1pMNGMDXFqgtIu9Sdm94XLty9jFbBFc71UkjEs/t4ww1OyViQ6hqROFRAqMp86ISlzhCAJ6qu0hAO5IvT0M5vTTpVLMA5WjZpt91wA+gw/WreGwrKaIF3biz01gf/JiRiMPCzdID/ftFCpT+KNSdxsfZJOLEeKNSaFT9GTWgpBU5lERF3P7DxYjwymHaQWvw== 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=GvJSucZCIwQtWFHFefZHH8o5izy9wD1tkxKMnEC2y5Q=; b=aACBxHw7G6D7OHprQyA72NYuDRI0Ip2BZWXxyxzYqLWWA/kYRgFfK+PjilFKXKS3tfM5hUeqMgz9PxO3Op9tzUm3/WDqnFpy0GdyfPg8KwxL/XhFJtzzGUAvh3y9u4fHxIrStxEej9kGKeMtfMG0uCMmC5Ct6TqJL4B1eW7tnIf0jxgie0qjURrsVKVe0ZPMYLaT9czWfxwdg6dWMpsoKOB7meGsM7lk9l0Gagp44nt7o/wo08o+osv5cPEpD0Ueg6DqzpdvZPcaRAVJ6EctjAjmaUulUzjKorqGOChvQDSG8pKo62vBt7wwAypAXvGI7Wa4QuJw1lwGzdUqjSlZYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GvJSucZCIwQtWFHFefZHH8o5izy9wD1tkxKMnEC2y5Q=; b=SQQbuU/Pc2kDdi0mMKNu2kHZ6WL/6I4ax1KRGRPL5uT10HLJL247RaP4UDTf964jmS+cCB1wbyOqrMYAngo1mOXCydsFNMKN8PsBjONCDk3eHQSEKd6RE6vjegnpAn03Ocn/ga1oICZ8TArFtG+BzMh7BEUxRFNV3uhORI0bdjCMJvZ8jQIyYqhqoOirXeFV0RZmt0Fwdn76PVdawpQ5DFpQvIbdLgasRs6xGJaRqnNFnijBGcElwBY8qPgRcbQtOh+R86P8yBoGy/BYLN1ewRVfIRUyaJCiAx6l/N7nb7RQgi4KLmg9qZwXW4lC6Iwd9tunu8y/dmAvZCoY/da5yA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by GV1PR04MB9101.eurprd04.prod.outlook.com (2603:10a6:150:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:02 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:02 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:13 +0800 Subject: [PATCH v2 01/12] PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq Message-Id: <20250103-wake_irq-v2-1-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=2411; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=cZsxdEVfnwbWB6VyEJvR/aoyZKsWpsHQZXR8Pc5i6rY=; b=j1W2wjxkUyGXeKstwZDwXLHFSM2SgXzdNMFeRi14fZeVx9+ZZtiyM8Xe0hbxRmrqsALDiNlsh Z+I5HCmQOy9C3IoAIY6cIOYoh8iGZZWq0onr5AsZ4tjvecBnbvrw/8h X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|GV1PR04MB9101:EE_ X-MS-Office365-Filtering-Correlation-Id: 605fc750-e430-4da8-2e5b-08dd2bd27e65 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?U7UcBL5QLKNo55cT/gAwsyw0Oy4/5j4?= =?utf-8?q?JnKGhugWTowujd9i9+fstyD3D681gwz/ppTkQuVZxqnBP+KKrke7eGHE1jh/78/FR?= =?utf-8?q?u5g+qFLSXf6l2k9B5NGO0eHC/8T1ZmnnMHAKslHbQ9OrtlZLZozKv1SPo6WxGK33j?= =?utf-8?q?B10ssgQMEmL16p33xrGvv7XrZUOj3ZMTvkAy+gPoThroNSuP0LqY0M9o9uWG3Gpuw?= =?utf-8?q?Zdoemb+JSX2YHpzaK2dnzmqKZH2Dlq2y33d/FNHXJlYyDIdUR/Og1pTpf5nq+QVO6?= =?utf-8?q?hdK/mL2dB4ycArZs24f0a/5Nr/1a0WNqonMVyeTTI/+3W6M3bulfAWCLl6ybQvR4N?= =?utf-8?q?UAJahi35boC/OWvKU727+/HeJsLciBjTg4g19Tx0qfZsaQ1o/2r7mU4WI+O8eTCr6?= =?utf-8?q?7HxCkq21HvCfOS4IHVUyAZNZXBDcBjZCbr4yoQuoMEZSs0D5rZoI+mWHsMo87fKoI?= =?utf-8?q?mcjoIKLRpwvgL5ZTKXsMxDr/roMjtUZYMIuO+AwxUjwv2wwrcl68egML0oNjEUbCq?= =?utf-8?q?UmqSczHMXTs6dHZ/MwwgeTbWgJRQukzpHz/s3d6hIFi9lfxqDCXdixKPSjWhCdxIa?= =?utf-8?q?tkhRl9/QGA4KsLpoZquFWaimQjtVG5MJPKzCMgofHGMxZUcRHsIdqq2ZbsyuOMztv?= =?utf-8?q?encIw0J7aUkBWOOGwAKQhrDEeA0D7ncmiKpNwDn+gy7MHblcOq8dWGX7fsmW10281?= =?utf-8?q?hMPGINzMgmMm7xeCE33oa3FpejkFySlvjs4efdm5/j3UXmYjaIbIuNGosJpDhLQQq?= =?utf-8?q?70UsUC19nGOQmi4+HZWLLpPvWryPHd/hDBSCt000Ula0R50gKjCNhzJHzSLuATICl?= =?utf-8?q?vzfqVzErAkk7wYhr5JwANb+Ym6tuuXPwqF8Br2scT/Hip1hDOflZXh09z/RE2IAQx?= =?utf-8?q?JoLAkxKBaHYvURCzlgVfyh2rcxmfocRz5qAUL9bvgLc862FnYqh+m84ofZKNxiC9z?= =?utf-8?q?TFl46IfqRykBr9Wc0vDm9jEt56ge41PxEEGWxFBL3EzBCHWAvDcv25WO83CZqr3PP?= =?utf-8?q?TfLvR5KUqvyhNoIFOnIWcj96QfZa9G5DIzyUydVMYk97lL9YxHG5Dm3LPRQaGpFGm?= =?utf-8?q?9UVK9Ohop+NZwmgd7nl5J7NThPNYxtrk3gb89V6xBJNypik5VuF63QX2riTtvPjjc?= =?utf-8?q?PNVmggZCXycqpTILogs1jKF0Og/fNkKkyBu17GT2cUcDSvk3vbgSMVYLEBWIqDGiQ?= =?utf-8?q?QRHoM1ZRReXUht9FRJzkk+upd6NusH4RHnIN7DTUvIdvjnNXpRBK4vNzadgWFSrGt?= =?utf-8?q?kXs25M/+mlCc9IFpzdiZ7IydEMYvHMgZTBbkVU6whsQdgWriOZO7DPPqIChduzP0k?= =?utf-8?q?0G48E+2oBNtNQWqjUAIjM+B0CzePgCOlLEDHpSQw15sLqw/B5uDG8hMyIPl80RSXm?= =?utf-8?q?pbb5jDd/5297ejyocQU27zIgfYhCwiSxw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Nkbk70wrQDP1o0pnEo5JPxzSgpTY?= =?utf-8?q?32goA2yTO2BbMZsnbv8Q8jcV76nE8u+4EmpAXe16ifG11BBllQ8cteHEubpzlOGWh?= =?utf-8?q?KtFy98Mr5ThB/O1HlIW2tG6AyttgT6NEhmXYmggqYBEJmzlu42b7Ej4AVkhSXmm1B?= =?utf-8?q?JiCViorLFPoNpl0OZxG6LGKgZPgauDnr5j2vK3B2dAmJLn7yvlrtme+/Kn3pO5wWz?= =?utf-8?q?oSo1c7LG/L7zoAoakjlmxCu/1KiMpP9eNxu5YLTCpye7/SoqrVGYuC2aMmPLNvHid?= =?utf-8?q?/UoGczdM5MLAiGsBg5NpH43H1O65y619n2Mf1KUN0Wq7EWT3gNzHw66A+VnRZQvaO?= =?utf-8?q?iUr2AR4ITa1vQqfP9prFOVi5wMfa3EDoJWnmp/aNRlV54wPfXrZFM/8PVzU0jxfp0?= =?utf-8?q?jRGvPf4udPqtC8xjwjL2vQfUyfJgfrwiZ5ucV03ZO0P/OBz5c4EmSXSU0CUktiMxV?= =?utf-8?q?ilicsWiW5oEeA93foCpJWqRmH/uAt9PWWAPdQxLqIqbZepzkbhqzxSGKM91YBidxy?= =?utf-8?q?Bmk3qdJvZgafv0TgRPchXzS3PuTUzViuz34mSaT9knkkN1CvSlh5SFVeLLHFjezEP?= =?utf-8?q?0/HfyjwKUgwfPRP7nkYeK/tGVHZsw0LQwvJhjjiykhLdwlRYw3cQvXRX0j1R6mznX?= =?utf-8?q?ZjdNv91U1xYBtIJP7WnPfaCnoeO1ziwvKMoeYQrw2kouom7EBh3ct7Rhe3SS8zCam?= =?utf-8?q?z0WzxybQtooH8nP50Oo9031AliierJP6cEaw397/uOk2K5VNZA0l669KrbPylN/qd?= =?utf-8?q?/+H+tE821++3U/D2NGpg5SNolBAl/5UpNRtItaVpHJJVMJyDDEqlNfGTKiPrv8TZH?= =?utf-8?q?/wNpcDT+Ol2vhfvePcsVupe9UbRbWJGKktJi3fFCtBbcWEiASalGESfWgh+ZfEw93?= =?utf-8?q?T1eFRGAXfOZ5eq6mUkK9wUoUs+ZaPB8FjmgRRFukf4axH1DopEGizq1hL8062Yrix?= =?utf-8?q?+5Bwl6g2wp6Mvh6mJgwazSOt5XwJJTXxZnvqoZwKDYzAbdjgaIyUSH6oGla9ckuai?= =?utf-8?q?+5CccopQOSix4rtsJbC/0fhgu+VWSCT+qkjmDi5LgriducHMCFFlfa3fYH8xbLFZx?= =?utf-8?q?uWoHUbEY4b0vPAiamUaczd5aJHThW3/CRcQT5SJQD+F2exm/7D819gdz+3FDFzaEA?= =?utf-8?q?nJ1OaZzdH3FcIbjIA4KFiL25wBsP4BPmxgD3m+FJsehftz1xH5677OQ7chBE94WAB?= =?utf-8?q?b7PkdpAr9uj1jiIEdvMuqfA+WlEVelbaeXOcS0mdA99+0EJylUDhUsKQhVszyIWy/?= =?utf-8?q?VdRH2mHZwGNGX1hEBpWNYRItkeVxL6sPMaBiJgcuxbPxDwMCHzkasGfME9cgF8KE1?= =?utf-8?q?jNwCe2rtYP6QeZXCgDYF1N3nv5DrmfDT5v7LF3TOhBzJ/bZpgQYnkWnuabFpY8gH1?= =?utf-8?q?31zqqThp4IZQHmvINggWUjFZsozXSIydrATg3wkcwy6byVQb6UBQyon/M1s+piNJ5?= =?utf-8?q?UrNnTGYO8eagcj6H7EShnZ/+Rvp6aA0NNJ6pYBxTEWZ4cz+k+PeYzasmBY8JtHQPV?= =?utf-8?q?E/hLQgyuRLDD?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 605fc750-e430-4da8-2e5b-08dd2bd27e65 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:02.1115 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 92QI+cW0ykw8vms9yGkeLmFh4UlLy1EB87SyEeB8Gpy3Jd+fCGIdGBl9ExHcq4l5Ulkp12486k73j81I7QY44Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9101 From: Peng Fan Add device-managed variant of dev_pm_set_wake_irq which automatically clear the wake irq on device destruction to simplify error handling and resource management in drivers. Signed-off-by: Peng Fan --- drivers/base/power/wakeirq.c | 26 ++++++++++++++++++++++++++ include/linux/pm_wakeirq.h | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c index 5a5a9e978e85f3fc9d89cb7d43527dc1dd42a9b1..8aa28c08b2891f3af490175362cc1a759069bd50 100644 --- a/drivers/base/power/wakeirq.c +++ b/drivers/base/power/wakeirq.c @@ -103,6 +103,32 @@ void dev_pm_clear_wake_irq(struct device *dev) } EXPORT_SYMBOL_GPL(dev_pm_clear_wake_irq); +static void devm_pm_clear_wake_irq(void *dev) +{ + dev_pm_clear_wake_irq(dev); +} + +/** + * devm_pm_set_wake_irq - device-managed variant of dev_pm_set_wake_irq + * @dev: Device entry + * @irq: Device IO interrupt + * + * + * Attach a device IO interrupt as a wake IRQ, same with dev_pm_set_wake_irq, + * but the device will be auto clear wake capability on driver detach. + */ +int devm_pm_set_wake_irq(struct device *dev, int irq) +{ + int ret; + + ret = dev_pm_set_wake_irq(dev, irq); + if (ret) + return ret; + + return devm_add_action_or_reset(dev, devm_pm_clear_wake_irq, dev); +} +EXPORT_SYMBOL_GPL(devm_pm_set_wake_irq); + /** * handle_threaded_wake_irq - Handler for dedicated wake-up interrupts * @irq: Device specific dedicated wake-up interrupt diff --git a/include/linux/pm_wakeirq.h b/include/linux/pm_wakeirq.h index d9642c6cf85211af603ce39e280a5b4de6617ee5..25b63ed51b765c2c6919f259668a12675330835e 100644 --- a/include/linux/pm_wakeirq.h +++ b/include/linux/pm_wakeirq.h @@ -10,6 +10,7 @@ extern int dev_pm_set_wake_irq(struct device *dev, int irq); extern int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq); extern int dev_pm_set_dedicated_wake_irq_reverse(struct device *dev, int irq); extern void dev_pm_clear_wake_irq(struct device *dev); +extern int devm_pm_set_wake_irq(struct device *dev, int irq); #else /* !CONFIG_PM */ @@ -32,5 +33,10 @@ static inline void dev_pm_clear_wake_irq(struct device *dev) { } +static inline int devm_pm_set_wake_irq(struct device *dev, int irq) +{ + return 0; +} + #endif /* CONFIG_PM */ #endif /* _LINUX_PM_WAKEIRQ_H */ From patchwork Fri Jan 3 08:41:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 855129 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011020.outbound.protection.outlook.com [52.101.65.20]) (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 7B9C71D31AE; Fri, 3 Jan 2025 08:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.20 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893736; cv=fail; b=UOgG5NHrSc6dx7jyw+QE6QXhgA+MJs0W0yj5eD8y8NK1MYcYTBOViaEp4zsTtDjX5Kg1UhZYjfJUc9oc58cR2umVzHsArATjMER8JnLPfBFcTHTyah8wzqWnX48/CBKTeGL5kLg5FFJOphVUzZfadrkj06FTOUkDArrsmLGZ0sA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893736; c=relaxed/simple; bh=f0XWM6xBggK2QfOcHzd3+B2023F378UQ/qXOqelOuSw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=sQ5mLN6bOmSeiiuc48vMqINUhU5Raofa+QUnsVhZarZ1quQfxOvqttQglb+XyukxEtM7U8nD0/m63b2Fpv4Z48S4W2NldNmkN9B99IWOsrBnPqMibinlCGWPr/a+vENKs6SeDzePiAk+jlyGNmc5Lhku+8nVykpp2cGthWuOWvs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=CgbFYNBD; arc=fail smtp.client-ip=52.101.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="CgbFYNBD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S1aH+MEkJL5DstVipxgKG6JRHaV/1Ve7AjvT5moKZG+24DF1F19ec5JL0AxlbkFVbweUK4ZVhiXSwqaf+lsxDxAR/4iTWFSnSvSxC0ch7STbUbgT/TrPNpGtwKF2hbSQFF9x7l3DXNwDfPshaE3AiOvR1arbtksbEWOlnRkdaGStWcCAB/Ak0Eb5IYJH7j9z1GUXO1eOL4iG8p2ybts9b8o7A9Bz4/gZoCte+K9Vjg2rxU5AGYqtTKs/XK3qtM2V6Io7tMJ0cQqWPrSWfDq1QirzQoFeOE48beVj92el+zZfLg81xn3W7NOEHbP+uCPfjGUUVf7CsZ/dYOHPHqFLjg== 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=zBJXBX/BlDu3iR52lDbc09nZRQMR+H0jkQvpTPg3SOY=; b=g+Gt9ZCwEdf+zk3TaGDp9Jh+IOMtI8QOTe/QVSUc+O9Y3I1/+UitbW2BCSvH1QSEiNhnJDKSdshSjUG4/nHf/zY/WqD9//hxz1j0UiaYOWBPB8zuPA0tpCbZgQ6j38zxeJIf+VH+w5vuS95gpzxDVl+x72yOYCrNjrewNV62B8zBfIFyoN4a/dYqTZOxe9eXD6riGHfD8dJXUS2EEv5r+WDgSgk5j/CNjZ5Tqj4l7EIT7K+VeK8W9LjxXCT08wNaRm2OE5A7EO+sFpbCL+JTnmbK7ZeMPW89gRsC2u9ggjPXnwIe82fQ7XOOoyDyXxq8Os5FSZ8TU1Q33OwKJ34RsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zBJXBX/BlDu3iR52lDbc09nZRQMR+H0jkQvpTPg3SOY=; b=CgbFYNBDuGz8UJ8IfWvKeqMsk9s3KcXjoeEx4/S6BOp25/Zo3oL10mapeicpDGrr49bu5aJCll+91k8laxyjbXk0SyTc5OReAJILBRqhf3aEMmPlI/6zhiUhZqgEus3slEop9raYPBZOBP/cnJpJNwkYKztrLBiTC3dZS3GG3ybwfkhOoMqfcfOMi2eeGlQbZsubqWeJdTRiPmPN6MNA06CMUECE26dQsikGMjtByRmTbcOurOVrGaGbCVavBPuWyfedfw3xAW3YL7VxtrzlTvjdvdWgVtwjvIRrimYIILyYonmNWhrjh8aDQazYkLcJsjJdHyNKjoUYU0DDUpUrnQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by GV1PR04MB9101.eurprd04.prod.outlook.com (2603:10a6:150:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:07 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:07 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:14 +0800 Subject: [PATCH v2 02/12] input: keyboard: ep93xx_keypad: Use devm_pm_set_wake_irq Message-Id: <20250103-wake_irq-v2-2-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1402; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=lLk6bV9Q4qc+HUdwJdc/NyACnoatpwVUWdW9RwekWXs=; b=R9/qzuNawG0lBp3arrRjMdx/n5J25HPKu2UkbM3HWbYO1/MmCJQ6naNNy0xhmrFQWFa1HqZD+ xfQu4IBNzZKBQUW368Fey1iMo3Zzkr4YqCV8xVtsxLgW9IUk/Wzh57Z X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|GV1PR04MB9101:EE_ X-MS-Office365-Filtering-Correlation-Id: 82b7a357-005e-45ff-41f6-08dd2bd28193 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?asvBdty9AVZmrCeRkxah9v1lEU7rBvF?= =?utf-8?q?rcQawffCbBJ6gqNFo/4yJqdYeEKK0CqT6bTginidNFH57t/mRPT/mocibroao4EXj?= =?utf-8?q?BGsiEMy2eTQSUi5ob2tUrqHRzQOL/ZV/eOEM4UinFTqbe/VeD6iIiLERqwCnCuPaL?= =?utf-8?q?TwACC3qrvpwIDx0ADS3pIdJNRz2Sd5EgfgYa3mipi/R36HZYrbj9fyQ+C5+3AJ7e0?= =?utf-8?q?y27lDFBM1xEVz3hfr8uD2csuvsHe9zOvWhtoDOJNKbAagxmyAwiwLGvcjgNG9vq0M?= =?utf-8?q?irWv45Zwxfgf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5e75tafqneFtfLMsGheJGkfXbIXx20PsIUgPoxjnJCnxM9RbxyWK?= =?utf-8?q?Te4U7DPtCKV0O35OmHwLVwPA3YZ6eNOpG9M1ylbqpJmHCTK/OoleNJjqBxnNCQ7Sn?= =?utf-8?q?V+EZ3KSgPEfaO9qdxtWJvBk8Q+IiEIUm646pBf7aVC9agcQte5D6quIcq61iAxMa+?= =?utf-8?q?9K7jlvPhRdh/ndnYWErGjWyLQqMjxeUtWXjtDVKu+lHPOVzwfqGJxd2WaX0yUiDcu?= =?utf-8?q?IKlV26VM/lo?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?4cLEK578CHRsNUcCoC3zPLdMsGIq?= =?utf-8?q?QuB1tsQKwEoVcJV4PdrSZMPSoT9QfPABbzajQgtR++nWEJ2IVq5OoSBIs+p6V8eUb?= =?utf-8?q?DoEVcxO8PgEbcdzTG+5K7ADbED40vrjsoBUaFSGUJuh/1ioju34ZalUahXbSi2oM2?= =?utf-8?q?Vc8X+qpWifEPe0NMHjkD2bBUpYuYIv6LKjHgf+dKsPTeYIOq6ZGS4B2ILARA7sVX1?= =?utf-8?q?kw39Vb+5JTKz9PP73ettaHRTOnrIpofsmFFQKbClvUgwdstDtk6Vkt8zrQPhgHfgS?= =?utf-8?q?G0l5XM/cs9ExCMC4rLeWtI+Ql45OyDVTurt+RNzaogyzToC8/26+BV9eB6UmsY1vl?= =?utf-8?q?+PgdEeTMP9d6zZIaljKANe6jsqerhhomgAPbI8fc8zEvCNJRltBBnpbBWE8IiDWxn?= =?utf-8?q?867n88N7x6fGjmu4GaBSt4irb2I91VE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S2RPo0dOnpvT+/LAYZxR6XHKaVqn71CSNog1V?= =?utf-8?q?MUoMCX6lNC/PLbFjIgxmiVlCSFXksWPBputjV5vMP+AkmnKJ1loyq0dAWxDa/zWvv?= =?utf-8?q?k+CWncJYtR8fzgzbZQ+s0bQvM/TCKLLRW3x2V9xKjPOHA72BW+DVI9mU8CjQlpXge?= =?utf-8?q?lYLXwNKKE0BCzrgxJxBo9ygo7x47aGgaUy8lpCAT5aGYu38ULXj8lrkCZ/7uhymU7?= =?utf-8?q?XoHVCoteo5er?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82b7a357-005e-45ff-41f6-08dd2bd28193 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:07.4608 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bVjgLhuqcubx01q2NGl5hR+bX9gxV96kxlnjqpwmNZlGCKPMwxzv/hI3L5PEmXuTX4/2xuH7XrhBznoEcUFLYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9101 From: Peng Fan Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up. Signed-off-by: Peng Fan --- drivers/input/keyboard/ep93xx_keypad.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index 817c23438f6e5176431e1f736bb511f9919b67de..6e3cbe3ca72dbd43485c23f6042b4fba007ff5e6 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -260,18 +260,13 @@ static int ep93xx_keypad_probe(struct platform_device *pdev) platform_set_drvdata(pdev, keypad); device_init_wakeup(&pdev->dev, 1); - err = dev_pm_set_wake_irq(&pdev->dev, keypad->irq); + err = devm_pm_set_wake_irq(&pdev->dev, keypad->irq); if (err) dev_warn(&pdev->dev, "failed to set up wakeup irq: %d\n", err); return 0; } -static void ep93xx_keypad_remove(struct platform_device *pdev) -{ - dev_pm_clear_wake_irq(&pdev->dev); -} - static const struct of_device_id ep93xx_keypad_of_ids[] = { { .compatible = "cirrus,ep9307-keypad" }, { /* sentinel */ } @@ -285,7 +280,6 @@ static struct platform_driver ep93xx_keypad_driver = { .of_match_table = ep93xx_keypad_of_ids, }, .probe = ep93xx_keypad_probe, - .remove = ep93xx_keypad_remove, }; module_platform_driver(ep93xx_keypad_driver); From patchwork Fri Jan 3 08:41:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 854983 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011052.outbound.protection.outlook.com [52.101.65.52]) (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 B29CE1D416E; Fri, 3 Jan 2025 08:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893741; cv=fail; b=Ezo9ABnufR7nR0fXrZHXeyySKaVc59fk62IgJ4841RTbm8MDJnnSe7XKZCbr3tKApT2YrZxKXGDS+KkFvi3+NwpQeJR/9jmk4G7nDPgjERh6/YxBFi7BOyG53tm7c+FepouaJ3LXEdSvdF5IKn5PFE9T18tdAHiISvCWxniF4io= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893741; c=relaxed/simple; bh=DNmSM/zlaiHe7y+SpoUtP9k7yyKM9LouOCBuhZSkcWM=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=T/H3ZzrgiUQDDClKAtB43PU88XOeE2fD38Oo1RqDqFL7m2mGmAt8S0G9jCRFPmHP43jNaJ/jz4Qm1A8fzCZZmfM38yVAEolsrhMGwZuWcYIODCsvtXB0+UEipKD2NtiTTIxSTcEYPhQymVmY1hI17BddXuxB3l2tpMv8mb6I53k= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=jWSlDaxU; arc=fail smtp.client-ip=52.101.65.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="jWSlDaxU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g1INAJ/bOnX7waGcQOg7lo1eI9rFoeSWtwOQGlYnLmwjeWgPOp7gf6HtI1fq/FBjkr4n2kV59rkDqf+MBpoG3cttcv17+m9nzwXmGHTw+rZztV1iRNKT3Xi7WqsIFFY26tck06O5gp4SfnMOy0a5EwqmH2s61vWw37rHOP/PYB1/3PSuob3ECeqz9fUrVpUjtDb7cy8hhaq/oAYpLuMI9dNE+Lg7uoeEawLOZwYkK1yW9lwqkIKhMSz1NB7E1x8D8D6CVdnQNQ3BntcOIdXhWpC8tVawaq1BlAlytFOhmcm+xo9d7nR2bdEZV6NEK79RBhsecqLsrt5zQIBZaJD5EQ== 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=cS+DM8g/1DZ++lGRTiLrP/ykpiHku6xeI0up7+EwB9k=; b=G8pNF5BbMuGi/CHzERuc1+FxxvpeB0hnl60r2JKj0G4ZS9rj9L7yxg2uig/d8Q0XT8uH7GqOk7B252aGTRqDi0b+gF8aP5Aa+mHMsQ/IHLynrLVN0e8RgffBpCwmwJar+ct5mTKj7mXEmrFwNpCL2WNx0tiobGtN3Aq1PbByD5b2mR6nhzUFafOJpeTJDzi/L7Nn0j92LyE+WrlwJb1b8DKuY4F1gi+zJNrUy6wxbkF9RYEXnBkpW/JUbsyD49Rx1HqWaEgAggWxhdcvhNlfmy4EnRXG5j7W0g+JE3UaRUvuorjiJhbOGl2knwUQcCjVrvb4yhYiRvoUO0Mflood/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cS+DM8g/1DZ++lGRTiLrP/ykpiHku6xeI0up7+EwB9k=; b=jWSlDaxUOQPubjn6YnL2IP/M+C+3hKl4+vaCFOPmLstSF89B5X4SBcyj0CPu9YCKlLrGY7socGCUmjUwMDi/79U4buZMFp3lHDIw4XHEJb80jokM0AqqnFqkmQBcSvqzd8CaXvMZ06ifKhkilWmPqZKgR0nNLyjFnvBdQE9zgpsmynnD+Ro03oI1u+84ClpdX1fSGCopZ116KYRdtr6BSv4PReC+FI1Gw08Z1juCKrFQW1eozfnVlXleyZs3Z1BLo1CvZPjBSpzXYMWzNkjwAPpmMY7X688/dz3tYWGNii7X3/Wkq2EwczsCBjtjABg2b+StvK/FIOzCNTRf/Lm3EA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by GV1PR04MB9101.eurprd04.prod.outlook.com (2603:10a6:150:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:12 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:12 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:15 +0800 Subject: [PATCH v2 03/12] input: keyboard: omap4_keypad: Use devm_pm_set_wake_irq Message-Id: <20250103-wake_irq-v2-3-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1365; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=IYFb5BcVnaCb3uUN830r92UAprUHpPfeHJSpQKDJq+A=; b=6nu0OAi33ocm78dkg6STG8L8Ee09UFhiaBJdS99JJA6i/e2entTy3W6z8anPmAJRyKnEZnYOi xtZqte/I1oQBSVE2uCc1ceFZ+1I7C7kgC1MkG7VRwOXgQJV3b/Wu1qH X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|GV1PR04MB9101:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a5b7492-0c39-4819-01b4-08dd2bd284c5 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?goOgq/mpgwllwQWs8C+2eaimSrTIBaR?= =?utf-8?q?9ewc2R421k32nIFex1IoWH7S8+1ADTyNqpsF9/06vMfE7xdif9FimIrCorPaAebL8?= =?utf-8?q?71JIfiGjoAdYzzVFljyuKDkbbmVoQ8C0hBO9Pw9c78mIqQN7eIID0P4TJZlgQpk27?= =?utf-8?q?8DAwoHi2klFdaULDiUVJP2XVRShNuPpK237WXCJZvUJVmcFTBbtgvdSnllmn9Z5CD?= =?utf-8?q?ZIzX6PEYnedFM2sgyEqY/9zQv3ulFn7nOb7Dgm0M2v3zOKi4dpe+t7Ka6azTpO63f?= =?utf-8?q?GgOZJNY4iqbpB93plLxstza32cRb0lT8497YvO1roPUTw+K+GrK9u8s4F5I6xyWE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VICnPv9S1cMTjmGDDzXoVV3Y3IuiZk71CXecZnMhuzOKnMoz1jzvoFZ9vsTQy?= =?utf-8?q?N5d6cRH7qpz063N6o78flFE70nmq0Z+3MQuEsgU9UDEja5dgfFXmJx8nUjrC1COgE?= =?utf-8?q?TxLKRpjGgHicJ4Q+pjC1r4qZ136pYLE0WMo91EhmPf7zW+1Vs4D53mCaagZSyYoeK?= =?utf-8?q?35jnU/ROc2U?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?b8M99BczmnWcooqSY1hlcurlBDAI?= =?utf-8?q?fKS5y01z6SlEjKMIY714K+MbZRMZCQdpbzJIbhm4czBY9opGNPRECDZyNQBOufiZa?= =?utf-8?q?y2OUK04K/sAJAvV0bYCJl/KeCZgWjCdKNRmY1UvD7MXm84gJMNi3h/hG0pfJ0NwMM?= =?utf-8?q?crwUnEx9taJUdc+5jBuFOQ5S6vFDrT4tSwFz5Xxj9OFUlUYEROAZRbNLrH5+v7Mpk?= =?utf-8?q?eSbrwRGzye+OlOcs+YoSKFIJYbZsXcP/5u5NOCJWN58Rwze98KfdM98XhRn9tEagE?= =?utf-8?q?pfy+mjipsOkZwssXKOPiBld71dr3J9OwdfPmk0Ge2up3dL+yUkSyyQuLE1EPsGs1L?= =?utf-8?q?g3Bu7Oz/rQ7cCx8mQ0SdfwlOTagA694czbiONjbIDue+EkEWFB0wcqIGo2e4H5+v9?= =?utf-8?q?2uyf01TLRGN6j+8S4lFLcE11JN8Tfubzj8+PCvfF5C0FJSPDsBgVUYnYM06SUR0tu?= =?utf-8?q?wiP6WDDda6XfChQeDRVx4Gn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SAHORmcgovUAaUhBk4whU5c5Taj+KV2AJThKx+4vqy8Nm?= =?utf-8?q?PhtkCEvpCqGBhg9/GIgLyo021uCiZUkpRf9yTg2QYweBtK4UF0mdKM3N+sRDHjnPY?= =?utf-8?q?y8ZTdCj+DlC1/dVNh/hgWJd2faHoRGW66pxMZfofNkI3YoxHQZAmhuFiG84gEMVSi?= =?utf-8?q?/l0W8N5gxS4R?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a5b7492-0c39-4819-01b4-08dd2bd284c5 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:12.8458 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8Al1AcWcXpcHbku+hg+Ivet65cdghWEwt0RvJoVscmF2Q0J6rZ/3D66Ut26X+mtb8wegDuWZFl9vECayGhy7ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9101 From: Peng Fan Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up. Signed-off-by: Peng Fan --- drivers/input/keyboard/omap4-keypad.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index bffe89c0717adf9ebe5b33892efa4dc30b158f83..b7bd649d1628a6bf10db4135f73778f62db92647 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -465,18 +465,13 @@ static int omap4_keypad_probe(struct platform_device *pdev) } device_init_wakeup(dev, true); - error = dev_pm_set_wake_irq(dev, keypad_data->irq); + error = devm_pm_set_wake_irq(dev, keypad_data->irq); if (error) dev_warn(dev, "failed to set up wakeup irq: %d\n", error); return 0; } -static void omap4_keypad_remove(struct platform_device *pdev) -{ - dev_pm_clear_wake_irq(&pdev->dev); -} - static const struct of_device_id omap_keypad_dt_match[] = { { .compatible = "ti,omap4-keypad" }, {}, @@ -485,7 +480,6 @@ MODULE_DEVICE_TABLE(of, omap_keypad_dt_match); static struct platform_driver omap4_keypad_driver = { .probe = omap4_keypad_probe, - .remove = omap4_keypad_remove, .driver = { .name = "omap4-keypad", .of_match_table = omap_keypad_dt_match, From patchwork Fri Jan 3 08:41:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 855128 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011040.outbound.protection.outlook.com [52.101.70.40]) (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 67FF214D2B7; Fri, 3 Jan 2025 08:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893747; cv=fail; b=u7ucxL+cO+m1aE+e/EwkWkAys2pVITvNn0x+D59Fy8bzffC+Lt61wvRmcHvfxaZq/Y0RzPftoJ8wtHGFnMdriPUvC0wynDhvOK6bWG0ZO+9n6Z405Kh2LDqETpmzmHb7A6AW8II6hnZ6vnENByDlWfxCT5mWczwUF6XvLB2O1sM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893747; c=relaxed/simple; bh=zQeVfeCxLWPp1ta82McHGDfqjkgW42mBMCjsal6VJxQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=i8Ufd/7PA8Q2Jvn3WFExND+VisT0C4Ku5NCNFrhEeoLWxzqbBlhdZhMCowIC/MikQUx19CHoQY9zXQTSDTm321gUujGq/2sPIwXe16MVjFqK1BloEGM56Mv0AG1wAdDtTm31VqJv3u28cm4h8wLW1Q71w3CKufv6DUzXCnh+d3A= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=cts5C0Oi; arc=fail smtp.client-ip=52.101.70.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="cts5C0Oi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=x8tm0uvqhIf6eroM2HkdsD8BVwwRNYKIWwxjflnKELkq4poS1y+SHTdOD/JbLRK7kdBOQyQbfsNcLPfo1hOZSTtPt5e1mi0rtop5qPSlm06knOFNBiamsQLESAqhzu2CF3UHPzl2YYaC3Q5CLZwL0aYMQTShWL9c+LQM1VqR3y914G0F0/IOvYPhREeGpSEX/evzRg9+B+ArlNJlbMVq0eT7+pvuQEc9jxtNuos2gcb4ih4KlQE2voew2TrAmBpcMYjnVnhJfYdQjAZ8O4J9Q41q5bGl44GQrViGRdduWe56nlu3fXILxclWzgLHRUy6vZMTcOn60+23ojiwCI01Qw== 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=eLJ6/6T287sMFeFzpA8pzl4U0kUK+AHmoE0BEwYo/f4=; b=Ja/dB4ugHm6Vcl2ZZFuh1oA4BY9dX6PnHP4jpoR9vZyCMvsIO7JxrqPRgVzI4UlOFhPFF1XPNGla9fiSCRM7FQx4F8xL4Lzh+1qCaXFjRAsKVsuQ3yXFRkHnuSrps6lpJy8JcU8HTe+5wwUDYngFhaNw6iGk3CuMK1pM480D9lGv0EWXNwqT3m1SkKIuve7P39kyDYdntx0EhGZ523+GI3mcUa3PE3SGxjhFkzBLhNla8BC66neUXhvLmfBH6iHx9781FFrQneffCTMmAd3ugdeslrMjd8tt4ASgEtHQwSxE5NQUg/8skI+qBQFozCx9fnMc0icKdQxe7LyBUdWvCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eLJ6/6T287sMFeFzpA8pzl4U0kUK+AHmoE0BEwYo/f4=; b=cts5C0Oi00MJZmoRNM4haR+LCAm5msTkmn2uRXN/MAT6bD6ZTGs/SBu52cdodHHB7vKd7FaMjQ2K9jHz+keG2LH14/Nqe4eA82YhsqEkt+SxAqjt/S4HJRA+V61N9dzyGMgN7Wg7QbX6E1t6khUDIbatBQjOjUejj98LsYWe2WPfED5u46ztmLhk6zL8sWN/R9EhVpO1D9x05ndsgpOqGSra5cosXwk64TbT5jAPP4qpDU4O1Byr2+rZ9DjhkL2oLL70okzc1a53/V43vnCM7bxKBgtxoazTqDslAPi8SCh9bNkv44kIctxuMaDcMqTiqSMb7K9oxW1JF2hy4zA1tA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by GV1PR04MB9101.eurprd04.prod.outlook.com (2603:10a6:150:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:18 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:18 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:16 +0800 Subject: [PATCH v2 04/12] input: misc: nxp-bbnsm-pwrkey: Use resource managed API to simplify code Message-Id: <20250103-wake_irq-v2-4-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1523; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=g2vZhAdAlG59tJHA7zmPtBw4oLxwHW1tSbJmlo9rLyg=; b=+I6HRtno9tO1xMt9Xr1J/+5hT5bkBUElXdcTiUS7rB914jnH7yIGafGxTvgx5xbyGDYPREEEM qgLQ9gN7uKRA7a2DGATSZHotKncPnzAyRgYkI8jhhuEYvA3TZtkEnlB X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|GV1PR04MB9101:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d65fc1e-2bc8-41dd-7b0c-08dd2bd287f7 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?GiATRaze0neRkDt8PMxNziufpXQtDiG?= =?utf-8?q?0jvAyn1kCCFxP8qQ1gKX7hRE5PxLX+cNVigg5+lfJnN6LV3TtzQztaR2OeHjFD9cv?= =?utf-8?q?IMjGRYjFbesm0S3/ZcKjjx4DPkdnHE9F9uRXwkJehDtLsEoaEqO8Ku/SufeQz82Up?= =?utf-8?q?a+cpO0jvdNNeMmuY6j5dHBtbCmJ/N+sXKtgnsI6js/rcqrZ/z+ULaMStKqRMisDC4?= =?utf-8?q?JHp6iI8oT3mApbYrBUwnZXcuQGtNgqk7O9aPy6bJx4UKMupq3nMoPLKQxGwq2yR2d?= =?utf-8?q?jQU6FhlnqhSXgnyL9NGUSkO7el+Yr9olL5yk1gSqqb1eSvpgUDu8MK+3dKgXSOWHB?= =?utf-8?q?wzzCzrQUOSw4ss16LFeL3UEWcvUKPEQPSi3lLdxgZllXdYsDvtFMl10+FJi7KgG4f?= =?utf-8?q?sH69YQ/YG4Grsetf1mf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IVE7R6HcDwvgAz/xWdAWHew6pkOhNjVnHwutVgwvy7oP8yWVEw0w?= =?utf-8?q?XNxlfDNvfqi7kSbyQZ3mJov2AalE/LI/1rxs0Q6t2zlhY0+5unj+C/N8EMblYcOJb?= =?utf-8?q?TiEFiofZdi3?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?7afgsJqcyCfKQA22SJPVZlfgGmlS?= =?utf-8?q?6h9zlubKXsEQzGlWHUw0wPMIHDzWO7CDJZW3ZHeu/IIA1TTrmAcz2/3ivA8rSGtHc?= =?utf-8?q?wiJZraw9ObHSMiwM9YXdaZ1UO5corJEZfzdD9oCd6eIWLa9mVQeOf7mH5PkMY+glq?= =?utf-8?q?CusJ6zHFX9Up5PfddtoqLmLHgcm9YN3VZCIWhAAUWr4Dj/UaUOmR+B8yXi3sAp/wQ?= =?utf-8?q?q+YX5/pmmzFqapubzpxAP6n8DeYQFXy1nd917ntAMIclqyeAMfVhk8alF+rqIIKsy?= =?utf-8?q?spu9csDS1hnMyPw6k1oLRxD9+/1+ZHD2D40Q1VDzmmRAWsEJXWzXNDwlR2FOxzuUF?= =?utf-8?q?H8C0w0xe3I4xW93OlFRuMvoaHiBYeemkHIvQP69NNM0PCcdeU0lR27AABlglxZsuO?= =?utf-8?q?GhFFvUW0rbiwLL9Di2gym19B4HWWdAFhcVhUsoBV9fONQiyyCMghRPLD6PjRXCE7/?= =?utf-8?q?QejGPDdN/5fhFzaTV46wrHJToW/WazSBV3NCxk4CXFgnttLEP+QUxfgNHFuonUpus?= =?utf-8?q?DGpVcm+zY+Ca9w9E3ICF/IJqos12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UFTqET0J0hsLGUu+Dzd7/ZRXU?= =?utf-8?q?7Jv22Vunxyk8aQYdZL/hlfW0MmIZghjuBwQrAbKacI7rOyTI8cAwMd6gp39qwxyRS?= =?utf-8?q?OB8Xpp0ER0Is?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d65fc1e-2bc8-41dd-7b0c-08dd2bd287f7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:18.1998 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: guPTvljsyGYzXe5O5VBVaJ2FUhM0XZRUy80MXfIHCNgH5u1s4/qtkgJW/BSEtHw/7k87VIluKfuvxEiml5HPqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9101 From: Peng Fan Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the 'driver.remove()' hook. Signed-off-by: Peng Fan --- drivers/input/misc/nxp-bbnsm-pwrkey.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/input/misc/nxp-bbnsm-pwrkey.c b/drivers/input/misc/nxp-bbnsm-pwrkey.c index 7ba8d166d68c18b396e616f6f9074ae98c4629b7..5faad2c98af35c52dcacbf25728dbaf2cbb3c625 100644 --- a/drivers/input/misc/nxp-bbnsm-pwrkey.c +++ b/drivers/input/misc/nxp-bbnsm-pwrkey.c @@ -179,20 +179,17 @@ static int bbnsm_pwrkey_probe(struct platform_device *pdev) return error; } - device_init_wakeup(&pdev->dev, true); - error = dev_pm_set_wake_irq(&pdev->dev, bbnsm->irq); + error = devm_device_init_wakeup(&pdev->dev); + if (error) + return error; + + error = devm_pm_set_wake_irq(&pdev->dev, bbnsm->irq); if (error) dev_warn(&pdev->dev, "irq wake enable failed.\n"); return 0; } -static void bbnsm_pwrkey_remove(struct platform_device *pdev) -{ - dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); -} - static int __maybe_unused bbnsm_pwrkey_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -229,8 +226,6 @@ static struct platform_driver bbnsm_pwrkey_driver = { .of_match_table = bbnsm_pwrkey_ids, }, .probe = bbnsm_pwrkey_probe, - .remove = bbnsm_pwrkey_remove, - }; module_platform_driver(bbnsm_pwrkey_driver); From patchwork Fri Jan 3 08:41:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 854982 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012064.outbound.protection.outlook.com [52.101.66.64]) (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 68D891D517B; Fri, 3 Jan 2025 08:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893753; cv=fail; b=PHN0XOAClWZ3bYX6kw/Oupc6DcCqfIiZfppwBEYyhLan7zq0GRwUac3De5f7l1Pbkk3lqIs4Wi3wySnd4inZaSKqHVBfvKn232sCbey9qqlZfeY5u3suZ2RzeMJ57+7Tobhn/beXnSyLg2dyvVfeVuEYZOZy43xsN6/D4GnHm1s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893753; c=relaxed/simple; bh=yGvaO4CE8KR0YjpwnelDEdIH1YkR2FTo1uOdpptvhd8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=N/YLCrXoLCC72PxrBP8p1BZ7//UH3hpMcZ5mUdAFbXX/K4LuIV8RbUAh0DqDk1PECv4GdnkiOVGgJVB4/zgRTEHOWxTuYTSresJRCwpPdmnHUXhlSd5Lvhd9/ziCyWCz2VoEWZBI4XWCkzXVBwy5pifPghgllEPYb3TdGohJFpI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=UzqqZG2w; arc=fail smtp.client-ip=52.101.66.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="UzqqZG2w" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UTjwbQU3kUsgvzGcCD3VBqY2J7+BYx7ckbBrgQCKX+8MCj4X1a9RY8hOfmcN6omDNc9dx7rkF6rW2WmFfHM17xCxijcq3wFIgaOP134Jw0iSq6AczjgMveuzdPVKhf/71t19EDZyZ0DkElxwZVKlNy0/6mnk6lqZoX1ZemSBS+awWHDm91jFYlzRTFR2Krru2dWN59MvKP9FCjN9ySWBwoBPhgdE3Ti0sPm/WmQLmDw8aUfbF4IOvUkuXX9/4Ubu9bXQkPfvKZaasHMOkCPlFWsUo7sbj0s3o6dfy3bSAyANcjKbbV65rAIcklpHxH33NeQDb1317If6DAVfMMv85w== 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=MhC1ngrU87eDqzUYVlj3esO6y93gVDOOhc8DDXGyy0w=; b=PI5ZGczYPQLrL1jP2Od5JiZSEG4FLCVBKFOubqTgMlA1agtGr2CVKGLY9KyvNKi52XuxpJgG4QgLzErtuxvUZaAzWJE9twsYiOB5f8e33OPVbCRbvl71DRiZaPJ5uGQ+P53+upzoqL2oKDhZ/j+7PInt11xgVAh15NUprJH1aUzl7L3wWrE+RscKj9NMtWwZyoYUO2kGUNRUS5lyLE2m5ddM+hUBmwy+n5D9ITlnzgcxcw4TBspE0pvck2e/kfd0FXj4bGjK0PwBPXjQPKSwQoP0j4kl8Zf6WCQeFrrNSFuxnT5b2XgA/m2sTdBEeU2f7hrwfiPrpUWefQ1elDz0JA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MhC1ngrU87eDqzUYVlj3esO6y93gVDOOhc8DDXGyy0w=; b=UzqqZG2wt7u3GOyLoPgZRvDb0RQGwAtCgwI1vmNZKRVjTpo07sVTFJns9v27st1R4idAwSHngrXtsOL9vq82o2EP5W0/YJHFEhVRib4EJrPLYim81mGqel+8asUavjxbSg48gJC+z/KqbKudGA/JvroHDHLYfXT9njob8Gj/rU5L9Mwnlg+nIfwfUe2EJh/2hwm/tRM3Onpq50VydBl7g6oKGgGgXO+q3Z8E5W34sIh4hTnQ5VODrj4xaRD4DgtMLO4yXmQUJzH1L1gznzVHXd/cxEz76fRbEfDEwGPHMB7QH3txBc3GftkX2byH6R/2ovO+igebHQO4pFZUytQCCw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by GV1PR04MB9101.eurprd04.prod.outlook.com (2603:10a6:150:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:23 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:23 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:17 +0800 Subject: [PATCH v2 05/12] input: touchscreen: ti_am335x_tsc: Use resource managed API to simplify code Message-Id: <20250103-wake_irq-v2-5-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=3411; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=1lZmp/EoQtZDgK9cRNpEHi0IbcGjqZ+/tYP3nl5MGB4=; b=d+ynM2f+87jzy29uH2AmtGEhWDRO9UQf3P+P0Uubu3afIPgRsDzhnXyS3RMl2g4FSX1MqPgcH dHCQMbcmHz7ChbsmlULhgPAwEhZEjpD+rfpLGpCbGI27Ef2eX0u0yKJ X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|GV1PR04MB9101:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e97a831-88b6-49cf-1515-08dd2bd28b28 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?utAUYH7aHERo85/NJvMafx9YBouQUuH?= =?utf-8?q?PL+xGqaDUx4fOsWD4ysejYogZ0sWn4Kc34rUd60V9vtXauWY+Sjn4QtOvzc0wzB65?= =?utf-8?q?LyDlpUXz2Prs/i3XJkrgJU4jvf7LHBI1AjwmPZfG0IFJtD39MOcWP1pN2pHsoe2Gp?= =?utf-8?q?0g0vsrdDfF9fqc3shv04FH+jhCr5p2lAm4baYBUHu9zBVcBcF8smaTaJ4of2F8a/I?= =?utf-8?q?L5YchhJYq34LPOJTDV5hjDTKvg34nB7l2dssbezu1enJVwHGTMz7Q22o6KENdQBN2?= =?utf-8?q?XE96lSrhgonIcvS2OvJfEquwtzcJ9ndlAMj25oR/NWShduvFqcoWmZIJDhE3sxXJZ?= =?utf-8?q?CrppFKsXaYeI0Qx5u+GWa4/iPyj4EWbojTYhG4D3wNwa84B3XqCewhAbLhezexD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?= =?utf-8?q?ZISLgXC2Oxu2RmzAw91dQfeh+gajcWFdTcYTFEz+cn8dC89136VFMHsexzTxa5+ww?= =?utf-8?q?eOBE91eD4uIg4Fh+gUsWa7wRw4KDhg4JlEzzCfWyU5ck0xy0fLuZL1ulGtaFElCyY?= =?utf-8?q?eN89hFSYTfb0TTSSD60zerqdjvOLS5dXw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SQgbRUwe+R9iszkwJFgpsffp/vvc?= =?utf-8?q?vMk+BV/HMbQ10W9UCZv6gO8nF271oH0c6+0nCCaaRgTK7tqHr0yy5qpZfG3S3Bfcw?= =?utf-8?q?ECibnwfbGOBEnv1T6oVwdo9Z/zWMkGa8x15PCv2q6gzyPV3LC2n2y1WrA0hFcw1ZH?= =?utf-8?q?BQljJHl5jWYBr3pQMZfIi9VDA3Exo3dl3wwy0kFWPy6YX+3lAduorKBYAFrapscmD?= =?utf-8?q?f7ZxPTexur40zXFhqC6xNgmUJblihKLCl226CGGSu8b2w+oUuR1Hq1FPN7OUFe8V9?= =?utf-8?q?sTzB/+v5ZD5Uh3EQM95B44YC9pOWdkyC6QNpB/rSUVZyN+s7U4K7703dDn4o0zW8O?= =?utf-8?q?R15pqjReY0dJX6VH+q80BEQgcoKlksryd64COAVwzVk8I6BB9c4Vmv8s7Pe4KfNmt?= =?utf-8?q?xU8G/IodXKVoaO2pT1pUd0mU83c+cX6aJWP4Eec7KxhrplY2Bw34+jDx/g2+D1mSQ?= =?utf-8?q?T1xNTYeGt+FvdJ2pcV1aOYm4uVSw49eD4BzlErKcaXJmLdvoAF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FB/UPL1D6?= =?utf-8?q?nX3+z262vfyzieFcy/tNR5534WA71Ze2FtTU7zLvRDt37UOYAb+iQ2UXax9jdR0sK?= =?utf-8?q?nbv1juB/jrX/PFYYGbmZ2un/hs9B4uF1Gr7hcI3On8Id1Sp5WVEgFesh6f/bd0vOv?= =?utf-8?q?y640lF2SRgqu?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e97a831-88b6-49cf-1515-08dd2bd28b28 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:23.6458 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y76hL7eWCAXZ4d7JTo9bVzePVFX0j2fzFAQMsLIZQ5JQTBOPaaIewcvUe031gS25x5U7dcSyP+9f+TbdD/EjpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9101 From: Peng Fan Use devm_input_allocate_device/devm_kzalloc/devm_request_irq to simplify code Signed-off-by: Peng Fan --- drivers/input/touchscreen/ti_am335x_tsc.c | 43 ++++++++++--------------------- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index 93d659ff90aa94ecbd7000fe05e0eef8ab3546ba..aef38b2e4e464e3b76395de5991a0f41b4f852f4 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -418,12 +418,11 @@ static int titsc_probe(struct platform_device *pdev) int err; /* Allocate memory for device */ - ts_dev = kzalloc(sizeof(*ts_dev), GFP_KERNEL); - input_dev = input_allocate_device(); + ts_dev = devm_kzalloc(&pdev->dev, sizeof(*ts_dev), GFP_KERNEL); + input_dev = devm_input_allocate_device(&pdev->dev); if (!ts_dev || !input_dev) { dev_err(&pdev->dev, "failed to allocate memory.\n"); - err = -ENOMEM; - goto err_free_mem; + return -ENOMEM; } tscadc_dev->tsc = ts_dev; @@ -435,18 +434,21 @@ static int titsc_probe(struct platform_device *pdev) err = titsc_parse_dt(pdev, ts_dev); if (err) { dev_err(&pdev->dev, "Could not find valid DT data.\n"); - goto err_free_mem; + return err; } - err = request_irq(ts_dev->irq, titsc_irq, - IRQF_SHARED, pdev->dev.driver->name, ts_dev); + err = devm_request_irq(&pdev->dev, ts_dev->irq, titsc_irq, IRQF_SHARED, + pdev->dev.driver->name, ts_dev); if (err) { dev_err(&pdev->dev, "failed to allocate irq.\n"); - goto err_free_mem; + return err; } - device_init_wakeup(&pdev->dev, true); - err = dev_pm_set_wake_irq(&pdev->dev, ts_dev->irq); + err = devm_device_init_wakeup(&pdev->dev); + if (err) + dev_err(&pdev->dev, "device init wakeup failed.\n"); + + err = devm_pm_set_wake_irq(&pdev->dev, ts_dev->irq); if (err) dev_err(&pdev->dev, "irq wake enable failed.\n"); @@ -456,7 +458,7 @@ static int titsc_probe(struct platform_device *pdev) err = titsc_config_wires(ts_dev); if (err) { dev_err(&pdev->dev, "wrong i/p wire configuration\n"); - goto err_free_irq; + return err; } titsc_step_config(ts_dev); titsc_writel(ts_dev, REG_FIFO0THR, @@ -475,19 +477,10 @@ static int titsc_probe(struct platform_device *pdev) /* register to the input system */ err = input_register_device(input_dev); if (err) - goto err_free_irq; + return err; platform_set_drvdata(pdev, ts_dev); return 0; - -err_free_irq: - dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); - free_irq(ts_dev->irq, ts_dev); -err_free_mem: - input_free_device(input_dev); - kfree(ts_dev); - return err; } static void titsc_remove(struct platform_device *pdev) @@ -495,18 +488,10 @@ static void titsc_remove(struct platform_device *pdev) struct titsc *ts_dev = platform_get_drvdata(pdev); u32 steps; - dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); - free_irq(ts_dev->irq, ts_dev); - /* total steps followed by the enable mask */ steps = 2 * ts_dev->coordinate_readouts + 2; steps = (1 << steps) - 1; am335x_tsc_se_clr(ts_dev->mfd_tscadc, steps); - - input_unregister_device(ts_dev->input); - - kfree(ts_dev); } static int titsc_suspend(struct device *dev) From patchwork Fri Jan 3 08:41:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 855127 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2074.outbound.protection.outlook.com [40.107.20.74]) (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 633D51D049D; Fri, 3 Jan 2025 08:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893758; cv=fail; b=Hv2qcYsIftT5lWeDLBFtq0wTrFhYq6UjedV/M+Y+9hWnx0Vhdt/BA5TRyBKspMH6CExm3b7tMatNyO7Dm7A1DAJoIArC/EqrOKcriUfRCCfrHuIqDh4akBVA0ya6KmfL5LDadfepMnBBKQucH2tT2h0Rm+pHgu6AZUCWZsQXJwU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893758; c=relaxed/simple; bh=JiSAV7Q4NNZurUbBcswCV+h/Lz5/1lhowxKOZ/KNAmw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ajiWfjinZ6rIs0j/re350mLvnVH7wPduPH+3Db2xZSwOWqSVZnvAgVVzeXlEQDwmxmrN4a94tb5Xdd2I2KRoF4q0vmiUMRAdCz320FVqaqz6p00Emarhrwm6Ernpg+igeplU3GSP7qg6FBfUXOZxBsckMtPm6XzxNXEKzberYAA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=fGUYm12T; arc=fail smtp.client-ip=40.107.20.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="fGUYm12T" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n9tZLXK96LTb5DMTa0oxE0gtTQ57pmJ5KDGiVAo5R6p6LlRoTZ+iu8KkEo5UgUYQNbWquCHM9RA78fk8JU9VSZnW2J9wt8e3A4+gcsH1KMKiuYYP+apZGkod/oGP9XtcCcG+QVxPf0CNdMBA+rWXMunoJ08FYPzMAkVXQPp/opE5k1aj9aQ+ch/SG4CDjFwKUjge0yK2fUSYunZTFkKuCWCbNo3krtmW1XAlVw/J9/4G+c8Ch0WtPd1eN4s5RpEE1Ae56SNktr4fQXdXJMqvSM7l68k4tDWzB1DXwH0d8eixdN7D+KUaajl3luMjk9tPvfJXrklTvdK1ycxAN/5GKg== 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=tvRxcJQkTcUxL+UY0CT1LkbMh/5QCJDI8WvxLfFze6k=; b=mDSjqbwFRfR3QBmdHtnQiHl9iqy4p3Y9k23qTai+X/b7qDExV6pNeNjFXsanGd8NbZadnDLImjIACu0ZA11GEdGCCUkrfjFBvsJv3/1Xg1OurbxhBwrbKbx6iulnuIo1P5Jm3k3m3DS8xri+sQohAdEvupRsPiHAhRbaUF0UKdexKuh/ch+ZEYbhaTf19Al7DRA+D3ILtzrSE8sL5nj8YzIVpRP26u6IW1g7pQWnwpHE50IN/h2wVtkb4tA77taPACWDiotasaqx4Rpq8D9XnSlZuOYMtQ3yWnOJirFwo7GNmnnv0YCDx9zxVHvzeWC4bH9jxExdTtnKR67TmCUvrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tvRxcJQkTcUxL+UY0CT1LkbMh/5QCJDI8WvxLfFze6k=; b=fGUYm12T/DQCz0A8aQISU6V492G83wjCCdwnPhKHUQpkImKdXiMH1j4RarlI9ZBQpa9PRrMVEBGyzZknk6LUjWlsYwU1yKR0QtaylOADgELkVd2+DrrXg0Wtge90dn/FplsmSt/y0fQm4lovOt4Bj/QBzC4FwXAoakaZfYm13GzI93n4lxP7ZSA/HEbmCclmOHnUJc9zXXBvoMBk/EOYXJr24rcRFeQh05lVqDooTlXUnPfswqjRv72xTOcS6ls3zvL6lHKjwC5NiJJ8RZSw4WyXR5BeOLajPQbJ/2uxX9qLbwPEZvr7uxjJ6LFWca1+BlfouHIAzPxI+f5SgEo3Yw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PA4PR04MB7599.eurprd04.prod.outlook.com (2603:10a6:102:ea::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:29 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:29 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:18 +0800 Subject: [PATCH v2 06/12] rtc: stm32: Use resource managed API to simplify code Message-Id: <20250103-wake_irq-v2-6-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1529; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=3L5kSry1bFWI+vzXqFXX2mukiWSnq2LH9PLt8NvYjoY=; b=Xu3sHTShAOCn276HCcSAjpYXzwQZYnEZUQUG/28E7wU8gCnra/3hnBowu+NsGfe4WKS3ziS7W vPvGrDFbiDDBnytnoXuv151BKhqwdVR4aBahH4Rtb6gqUmgcr5INuXs X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PA4PR04MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: ca160c3a-d728-47c1-9059-08dd2bd28e96 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?r94CWFcumbB4ouNkph2vND6kqqGZs0d?= =?utf-8?q?lKrrCasK0sfytGnMdGKuPi8576OR5R0ZpIuXFNLz24M/LoOeg0opoQInrA4nHbLcp?= =?utf-8?q?h0Et/k/zJQe6pXLO9EkkylH7ScHSzsMrL646nZu6wg2tmHMpjPkWhFaULgFwwrftj?= =?utf-8?q?hMv217088/uqHp9KaLgzmRERxuYb5rTBp62gKlV0gRWr+EPpJOh6cLXbMWMYMJgMJ?= =?utf-8?q?WV80ZsUX+o4UeRXZ3oIOyODKV8YPZGu+6g77z2MOrv70BAtmfxnQS15GImD2onhcx?= =?utf-8?q?sDz4uNzR/sLl6mHroNWLEMfIn8I1dme2+Lf1ct4wCyNDJHR4/7t1Q3xNdWxgGN18F?= =?utf-8?q?rAr1ZtH859VO9BtyTemhdMlDYm4Lst4XajO946uO5/0ZiNyvYqy3AgV+xM3FeUbNc?= =?utf-8?q?ad2Ap6AT99iz7FiesuJh0M1ljBN7+p0F757kdYdU8Su6aKnQx8toB0G+IB17d+lfD?= =?utf-8?q?Ku8pT7nxaFLsJEFryaoFLsET4mXdc1y2v1BkyD/VM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1yi1tzw?= =?utf-8?q?+E1zlLsO6VkyN4pE06jp3E2SKRGNW1lFA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?LqDGQTaGLz57pt9o3+FKbgwQnNse?= =?utf-8?q?ZoU5+TyUZFtuf27+0YMXFNBoFo65gCcup+Nep7fCGasLxQkB10ck5d5qjxhnzwG/e?= =?utf-8?q?Rbqr1V5CBNUm1Z7iQkka4amSM6yyAURmelZ8+L2LuT3hSbiQeZdN/l2HImukN/Tqw?= =?utf-8?q?krDx348cw43UrZvVk7ymqXdc+6pWyBZfjGrPlfOmC74eRTiYeFjGnLwpnFMy7PB5a?= =?utf-8?q?u3cOgjoSwesZxEw/hS2D0h52WBO5yNQYHP7KOXWucEhJu6SQ6WWVJDFDrkJ/R+wYM?= =?utf-8?q?pzDtxHeDSxaVHs4O+6iSJdmLAoPgjTjiwDAYRsehcjkgutLf8qbyjIT6hQAgbkIsN?= =?utf-8?q?S5aeGRYCziUfVrgRvlAvJ4Lw8qM9uWBXWqqMcor0FOTAvyWvOknWMTbWfQ3gS0r2t?= =?utf-8?q?toKfn0zGukdl+PWZSQkecB5F0UuLQm8Z/LtYNIAa89csPYn0DRT3esEc8Mgbfb0sM?= =?utf-8?q?+1jOHbIWUbaNlQjlGh7B1Yz03/u8YkG9CYfmarjRf0Bx44DIczOctboeqYjcruImI?= =?utf-8?q?1YHX6JNLtTUlrP7C9o2lo4pTLvEKlrAB72ytOaa7LQS+/GJS3cf3ZQuXeo5fRIuOd?= =?utf-8?q?fg4IGiD7uX1do4J7DkwrbwH82eFayuv1dqCvoktmEb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8VqNTuituoAuOtEzSMm6ga1ZdT?= =?utf-8?q?d4NXcq2Trq1a?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca160c3a-d728-47c1-9059-08dd2bd28e96 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:29.2992 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dkR6W/pclZiIsEJzYoDiIo3vnWW/iJPYiyS5Q0PmwImUWFPl9uIhTvvxsyInNit2cAyD4JzwhaUbi+W4YceHAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7599 From: Peng Fan Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the error handling code and 'driver.remove()' hook. Signed-off-by: Peng Fan --- drivers/rtc/rtc-stm32.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index 9f1a019ec8afa57245c6d40d378ec50fdcd64deb..183017b0d33d10481f94891de24cf2eee95893f5 100644 --- a/drivers/rtc/rtc-stm32.c +++ b/drivers/rtc/rtc-stm32.c @@ -1151,11 +1151,11 @@ static int stm32_rtc_probe(struct platform_device *pdev) goto err; } - ret = device_init_wakeup(&pdev->dev, true); + ret = devm_device_init_wakeup(&pdev->dev); if (ret) goto err; - ret = dev_pm_set_wake_irq(&pdev->dev, rtc->irq_alarm); + ret = devm_pm_set_wake_irq(&pdev->dev, rtc->irq_alarm); if (ret) goto err; @@ -1216,9 +1216,6 @@ static int stm32_rtc_probe(struct platform_device *pdev) if (rtc->data->need_dbp) regmap_update_bits(rtc->dbp, rtc->dbp_reg, rtc->dbp_mask, 0); - dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); - return ret; } @@ -1245,9 +1242,6 @@ static void stm32_rtc_remove(struct platform_device *pdev) /* Enable backup domain write protection if needed */ if (rtc->data->need_dbp) regmap_update_bits(rtc->dbp, rtc->dbp_reg, rtc->dbp_mask, 0); - - dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); } static int stm32_rtc_suspend(struct device *dev) From patchwork Fri Jan 3 08:41:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 854981 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2058.outbound.protection.outlook.com [40.107.20.58]) (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 702241D14FF; Fri, 3 Jan 2025 08:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893764; cv=fail; b=gH45UwVyjst0il29pALyvatnvzdmxTSPe+tsEmlgdr3I/4X6vjVEXZbLutatWA4MUuOGQFHOh1krTJB9aSHUTaB4TNk2IKO6zC4bV0hUGCM+3Qy+9WOZ7PLKodTwnL2TopmhZQVT6Nwd9jEAjyBxn25TFtJNKJxCLsGb0ocT9ig= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893764; c=relaxed/simple; bh=bGv4dF3gwaQ8/rybE3qOHzdzrW8kBSYtqBarBhutlJE=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=pWxj6XfEhp3AGkRPrZI5nGGqXrUdUhKK3GUHHuseUzRjJQCQ41jiikU4vhPipXuPDARrYDqVeh2uM0ogDFrVcPfcXSNK0XWht8mq1C4ZeO2xvbpcKEIV2JeSmj/C2C9fq66c1p8q7SNeXNeSj/HVW7/DpHBgSXlTt295UN4PKkE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=wCGHfmJk; arc=fail smtp.client-ip=40.107.20.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="wCGHfmJk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aOPYu/jF9/SCCeRnvhLOfOGctYxsmO7WXa9ShemzMzqeuwTaUhhzk/w1stNS5xQ2DZ/dtFzmOwzmnxflT0ELXjgPKpsqASyo8vyvmcl2lZgNsviObWQ/Qalp4i1SAGm0pUfTKVW/yqYR7Q87rU8eUy4Nb1JVVz9UIPqmfP4lOuSsM67F1DVZWuTvqZ55P+/xJNC02495uqKaKJhDkZUmMfaw33GgitvBfwZ/Wb2a6j3ULvwAFoCThkD5rHD/T15YdpZmloDsOGNGKKXSiufOXpcSON0ZRULkLJyT0lKRI6xnvyCc+TCjFGfTD/fZMoBIQX5PhGJaMhxHGjL0+1VGZg== 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=VFg5y3TrIOn9VH/jNSFVTNtUnnNsK5iZCxLymVMVirI=; b=n7+9FX+e85Ek1w2uOgOWwpxZkery+EJHyUqFuiOSGJPCqTI5U0vqE3HdryBsAgn4uLp4AlxlPxEUuj7bJ2fHxS1/vdy0s36OQKnEsjbfxGqGtcePTVGtFPgu2oKJ98BrqE8srZzdh3dzrqeVEfxAaeoh7dEPAXnZeuJH/UHP1XpT4V/ydaOEYWRwo6kDFfBPsBSQHg/pQxTVwzQdMyWD3g3wHyEGJyPJl5HhLv2fUoZnNIhLIsbcaL7+Ch9EABXutYOgi0AwaieO3xe+7Iw8sPlcR4WSi5lzU++kqpx4cLYmriypwSpdg96nrnkcwaC3v43/Qa3OyYmAnwi2J1fwHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VFg5y3TrIOn9VH/jNSFVTNtUnnNsK5iZCxLymVMVirI=; b=wCGHfmJkhq7G5hMBmyhLCziZKfqotmzL7S2spd2FQB0hf9saaSEZUUiwITRzMv1YXA30FIdzx/L2zJg0V2pbieM7SwL7c+iomeuQjVh5EZzD3/bSE5oLMvAcmc3GK22QRhHIZ0fh5+T6Qb5UcA2B9chWU49xAwbWZCYDlFEGYt68gtKEZE1pFBp1COOSzpNx/uS5f6pr7M1W8xqYm4VcA+tAp7ycJqp3JonC9tIvIkbyvSdTJPHEb/8L84SeFZ+bzzYyNOTfAUr5s+gcD4DqLJX4U17hiolDAHZlcgL61Qkl9wE4oTsAsSQ/Xf3eP3RxBHr1lBhn14vCHPoKq67LCw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PA4PR04MB7599.eurprd04.prod.outlook.com (2603:10a6:102:ea::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:35 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:34 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:19 +0800 Subject: [PATCH v2 07/12] rtc: nxp-bbnsm: Use resource managed API to simplify code Message-Id: <20250103-wake_irq-v2-7-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=2071; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=VAulaoWVPhHtzgpO1nG1u9VR+bogAGzfLBxhdt2/l0I=; b=SJnE6nTcSAS4I1d291x5RNISbMdR92Y3bdxMVEhj1npS25/awsjbGzI0msy/0HB1ZZ6MKzP/4 7OsAdosToQ/CU+1nt5kyf4smIDYXBQh0LTFZYtNiILaJ7E8DONqwLFc X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PA4PR04MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e8242c8-3877-4214-7a14-08dd2bd291ee X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?SQ4fziKKoDvvxgJ/gF9XF6N0I2D2JIH?= =?utf-8?q?VF1L59Syc+jW4cw2pZ8fAJkhouICBHOehUE0TwOrS6VuO9D1a0i22sivMfLkqwuIB?= =?utf-8?q?ry5h5MrUIyWjsLlRTxSsX/omqCNX1sNP2YyE9Y0qlrFsmtQK/aXxDyBPR1pHeCEeh?= =?utf-8?q?7GpbVdWHdbfiL/uZvqu+FzYZlwoTphhGyy0e2fWMY6wi+0ihZayMHDI2BVbuyeSR7?= =?utf-8?q?7cr9QJ8Ugo4fRlHCwLpTeyWcUizspY6JnMAuavnVinQRm1FVSxDQq/qojRRJ3Tm8a?= =?utf-8?q?exHbmVXkLHtkMacVxkoN1D+S8BP1iOEo8lKuiaOP5U4RvVM5r4DYU29tRRoiTgJxg?= =?utf-8?q?eABFIJpqz8JX8miN/6F/DLjDqLce/yAhFjjAMUasNbulAy7w6YqUQOfmStBhqpy+l?= =?utf-8?q?XLubmLHUdEWUUP5RJmZWVGG+IhFQbyk+VjlDSBGoy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c8l+LWmKH2YtcGLNDA?= =?utf-8?q?tl7X+sNTMipfOIUGnf1d84PdSy3l6XjYb+9IJhHBumzR7lpMhp/95P3yQMfpjJVmu?= =?utf-8?q?DAPcb56wc4t?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?yM5Qmz2csNCgYd1N6skBTXDbspxq?= =?utf-8?q?0q+ySPv/giEMGY1hu4xpNZPvwCE3ccA4y0q1ghCOYhBvHFQaGWkAipUdsgGyRxLQQ?= =?utf-8?q?DffGHhT79a5Fexdf5sFE9+Ead29ZJ6DGAqNKdWDIlJZycG6Z3P8N5l5PTu4nGcYuJ?= =?utf-8?q?1llsuflkvE2ZfXGwR6DIvmojrPajXP3QJ+kM2lUNSGdF1RaXDZNi/iHcc7btKc2VG?= =?utf-8?q?I2A6Te/jqm+saeodjI1v1v45d/Lh3HRWhucefpP+LTkHuGESrvSBup4CegVR8p04l?= =?utf-8?q?54vnvG9P+tgAqD3j7ie0FNMgS4/ZeR4ZkmB/OmW/Nc2CXxUjqVavLIlQp2wTfwKmu?= =?utf-8?q?xI+7b+8BW7dypgKuRl8o5L3SfQHED1lnAzKKZdQoRW84Rr2Lz4RkPPuUE8YUJUmFV?= =?utf-8?q?+rA2ZRsM3Y5xPm+0GC7kw/VP3hInMd2mElhxLAECdRWim5mKxmZwGfEETaZ3s0Y60?= =?utf-8?q?jTX714WJ5dAot4Hqz3IOZNfGT1buTpe1kbKHUDSfSmraGpYqCG/g2zgAW4FMT2iaw?= =?utf-8?q?QqYZrxRawWU+FLXzmxBxqMNZmVvzh9/PbWQvG6+cWn7/kRbN2GXW21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nYgq/E3rtmOcj?= =?utf-8?q?kbiivfjjZUF6ZZQexgEcSn8BdAGy6WxlFojpA8oTchCU6wWWpO+XIfMuTVNxdWfV6?= =?utf-8?q?lWtfVxGZgLjB?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e8242c8-3877-4214-7a14-08dd2bd291ee X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:34.9490 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: r/KVS2/gkm2jJ4aI02MLeFct2jN6RdHkYRfkgON8K/K0gvWLm3qOhZzt32hIVf9Wv2ZJowH24RKxaGE84so19w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7599 From: Peng Fan Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the error handling code and 'driver.remove()' hook. Signed-off-by: Peng Fan --- drivers/rtc/rtc-nxp-bbnsm.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/rtc/rtc-nxp-bbnsm.c b/drivers/rtc/rtc-nxp-bbnsm.c index fa3b0328c7a255ff8a902a58d61a4b0e59eac493..d4fc9dc583d317d4852b7d897a6c45cfff6961a2 100644 --- a/drivers/rtc/rtc-nxp-bbnsm.c +++ b/drivers/rtc/rtc-nxp-bbnsm.c @@ -189,36 +189,26 @@ static int bbnsm_rtc_probe(struct platform_device *pdev) /* clear all the pending events */ regmap_write(bbnsm->regmap, BBNSM_EVENTS, 0x7A); - device_init_wakeup(&pdev->dev, true); - dev_pm_set_wake_irq(&pdev->dev, bbnsm->irq); + ret = devm_device_init_wakeup(&pdev->dev); + if (ret) + dev_err(&pdev->dev, "failed to init wakeup, %d\n", ret); + + ret = devm_pm_set_wake_irq(&pdev->dev, bbnsm->irq); + if (ret) + dev_err(&pdev->dev, "failed to set wake irq, %d\n", ret); ret = devm_request_irq(&pdev->dev, bbnsm->irq, bbnsm_rtc_irq_handler, IRQF_SHARED, "rtc alarm", &pdev->dev); if (ret) { dev_err(&pdev->dev, "failed to request irq %d: %d\n", bbnsm->irq, ret); - goto err; + return ret; } bbnsm->rtc->ops = &bbnsm_rtc_ops; bbnsm->rtc->range_max = U32_MAX; - ret = devm_rtc_register_device(bbnsm->rtc); - if (ret) - goto err; - - return 0; - -err: - dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); - return ret; -} - -static void bbnsm_rtc_remove(struct platform_device *pdev) -{ - dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); + return devm_rtc_register_device(bbnsm->rtc); } static const struct of_device_id bbnsm_dt_ids[] = { @@ -233,7 +223,6 @@ static struct platform_driver bbnsm_rtc_driver = { .of_match_table = bbnsm_dt_ids, }, .probe = bbnsm_rtc_probe, - .remove = bbnsm_rtc_remove, }; module_platform_driver(bbnsm_rtc_driver); From patchwork Fri Jan 3 08:41:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 855126 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2060.outbound.protection.outlook.com [40.107.21.60]) (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 69FBE1D5CDB; Fri, 3 Jan 2025 08:42:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893769; cv=fail; b=Mhec7ZcTC+ehO+7Mji5GtkOdkSQg5DpLQG3huscJfXqDyX+4x4yZLVhIuxrzwQlpno/Sr7oATgPMVrfD8ibzWNrFteZ++zBIB7AkvzNgu1ExkVvFYd6Ekz2fDlpESaA4KtXPVlMQgI6MqR0xeE9Qx2eqmo58qDapgWn6YOgGp90= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893769; c=relaxed/simple; bh=BO8Hwal6yUEtmatjGxTeE8CGMKa+r4910TYtu1OW9Cw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=mOnhVeu7mlJ4arAq52lDPpxxuVf23wPOTHFf6NpZnXLcSKRcwv/P3IXc94kEX28Jhs2cXRsDKqho2Z/96Lb6tlmRY9Yqlky35KAumUdLJhGUri8r+x2S+ch50GpE1RKMRMVkCVU3oNkHKlXf1ZrBX/vUZvnBOf01n4kgujTNXro= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=JM9SRDLL; arc=fail smtp.client-ip=40.107.21.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="JM9SRDLL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=buf2XaHbOo0mnUHhZBium0o4JAe2v5OHZ1ilDaYKSUwdIQ+rOI5vu2bs2oHD/wxkTsV+NzCG72Rm92V2IUQoxd5PNNfi66bThVNcmEyQqZamJapaJNXros8Omqem7u7jAZt7oCDhArkOMtk0AF2v1Oq2eSGShFL/rrrpbbq2K7ufyJvIfjiI6JDnDcFaHNPetFDmV0HdAp+pMj+K1C6DeRbTPgSLLqKzeJh4FDY4eawrW8kny7uYRhQ5UIAfPurgdAuV37E9K1ati5ZwpzaI8xfONrkgweR2tPmQOLiRc4T0M9g5wjVTtdXjFK4PVPIjbh6RI/awaupwKBsWDCt40Q== 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=YQmjc+FMqh0dI0wNgt8HMjgVvX1TWtUXJ1FCgaXAoBk=; b=IpM0rpaeD6cHgPulshGi62S9Lvk2VaqvRIS+cQm22Kg/nQkjZjvIrvjLwxBj6bivtvDB+3kPqYsq41HELwQFwb0qYX7TgkGB+H1DgJb55LswQ/S4gSeHw0JxiMt/3frxeKvC3AUtZsfl66A0lYMEe+MO+VUqFc1/3TPvPyT7cuunFInJQgsKThBWP8qPgt1uRRFaKuKwJt5jL/IBbSJX8VSuXZ255ux6JMwzD6hnFD+arVF/aS1Ga0ikDXeW2Zdxwn++Qz7WF9jClcMrn5ed2mHN7/jKxGIqwgyxMZqe1Qha64mAUQsX5sw7RzMmV31cB9EuNg65KFz2/tVJgTUloQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YQmjc+FMqh0dI0wNgt8HMjgVvX1TWtUXJ1FCgaXAoBk=; b=JM9SRDLL7Iai7G4X/dCL/0+6Vy7tLFMfeOqFCpg+N29s1AB5cGuB0YHlfmq+wczIphIuevu0xZBjXmxxJTloR9EyVGHTDCDqfm5FshggeaAJ8RL+Sur37NuwAg9dxQrr+ezWlIqI9kPBUw5aGEOl2U3iGAJBfKwrimcIgL2aUCIsFW+L1FIMNSQQgi46QeAnniF3MpwKq98FC3tYQFip60ul7GngCC2U5lABIZHMw9x/9Bwg5SzrAZZe4O46Ue3fBAWIKdjoPWJUwL9pKKoX7BPIbdjKnhBJluP0KXwnL+yRBmEETvLK90mqQoGs4QCkX/5h+qqknge80DMOIRZ9sw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PA4PR04MB7599.eurprd04.prod.outlook.com (2603:10a6:102:ea::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:40 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:40 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:20 +0800 Subject: [PATCH v2 08/12] rtc: ds1343: Use devm_pm_set_wake_irq Message-Id: <20250103-wake_irq-v2-8-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1119; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=yYeVC601Fmqm3h8IRsE1e0gqqkwuyZ6uKwkA4brZ+6s=; b=frrewPLMHBqjUxMa+a+fJPMsZKvOP0ydpssUsy2Dl4jy3KEwpr2k2XS9bf92qot4Pcgk5A5Sq btsu1E28jMfDRRyXatmaIw5jJojAERsH5wy1AoFyaExNc7XvPuWJVZg X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PA4PR04MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e33ee89-b252-46fe-0276-08dd2bd29527 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8h+Z0SInAu438Qh34FgonUaCyj3mVaT?= =?utf-8?q?SDVsxgA0Kx+0FvYUXnfyzNHhVhe7z853f8SSeqyBW8Xl/En8h1ZlgsNfm13PQgwCn?= =?utf-8?q?DKC19UkaXp55Vq5LMFX8WAPJVYL2WtfFLYecY2/+vDwtung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t3IbO1qEPEPUWF7oHNqP?= =?utf-8?q?rkgPDjAGIBFs6APLWkOvG3ZEZFWtzyMMlKUM4F+LwmwY7rpziGuy0Fm3HrkLoWJkV?= =?utf-8?q?CXDLb5JekBwzvYDVo5IW+JMz3XNhoAeecj5EOCf+Y9WyzWNtZY8CUyPWIVugZaQWN?= =?utf-8?q?a2gJhbKaWZwGUn2Qg1uwUz1HWcwv965L8K8sUfoIkpIrV30VSQqp3Ev5/F/RGc2DH?= =?utf-8?q?BKNdCsLIEb/wzQwODWhiGEQnY87NYZGwEF83Q29/d6pk2qTfSUuhXu81hV/wou8pP?= =?utf-8?q?yggPw0ibjwt2gI0wkE9F5Z4BfXAXFXftLPb0WoURBs4n034uQeIik/koiaDtXVt6g?= =?utf-8?q?pHCRL8oVbpk8ccoo3K9kIqODCIwwwaUBXXi+01qVR8GxlvUIiV1amNwYJx3DA2LTu?= =?utf-8?q?BO+SvvPweZ/CvuEMGr/ljdiDm8PwdF/Dg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qYizM2P5pWYtzoxyZVYPCusUJ9mX?= =?utf-8?q?X14AEFGntCo18annxnTexj4IbMNqwy+yUXUqqDl8wjTdtUYzdMHS0Fd+VEodxEMqG?= =?utf-8?q?QbVJVyiJ8YS4yJoZyU7cGEGIzzcQSek26sVwpBMY/wyPUY5VGktRKu9QK1CiiYHJM?= =?utf-8?q?9wNNVlNl08NqCU0UMsCluSvX5Wl5Ry2IiXCp9BJNOaBPUnGG3Hi53IYCZrGjvUUDe?= =?utf-8?q?nnSxpaTUmUVYpKF68e8Npg1C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fNd8LofsxiOE2n10Hd7Cvmx48?= =?utf-8?q?Xqx6kctsVNJLBoCZfh2JcP6S5UipILAwnmndRSQyc26h2KdT9HYgYBx64RXRi/MSt?= =?utf-8?q?FMBYQpBCkhfyCe3XRMd6XdrtFZnKLBkazdr+78CZwEgz+xoxTIzEADLzFbx4NU39N?= =?utf-8?q?UUW9mNN19TjZaxVbI5tdgJlk5eA4/Dteiymxg4fbPgvnxPpAWy6UkyAsdPyIiH7yw?= =?utf-8?q?9WS65Ibgt3S8oUSwAuBLSpWV9qKcCzjtMRa00Tf8BMWq40gtTBRPNvw4mNKqaPfvE?= =?utf-8?q?IQ4SDLiyV2+bce0rh1ZuS+o6Uu9DrOGikDGqrEl76wXLYAcIRouZGRJHlrAqFZtqF?= =?utf-8?q?2iWqGWZvFeWaTvEKVG0yY7kazcmJuLItPq3afjiNFARKSfJSaMrkroMoJPHBb7vRS?= =?utf-8?q?mtQ1MSFRQUuA?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e33ee89-b252-46fe-0276-08dd2bd29527 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:40.3434 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wDzBr6FXHOMthwGDfQ/C/dZA7CYz0zRfECADuFYnbw/BSLbdC2r6oP56L2fp2IYOSwQs63Z2G5k2boNxvFjDGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7599 From: Peng Fan Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up. Signed-off-by: Peng Fan --- drivers/rtc/rtc-ds1343.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index ed5a6ba89a3eeb2a0b9d6dea3c8b3d40aa2cf317..aa9500791b7e0300b150bd654b69c74f3e5e6e6b 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c @@ -427,18 +427,13 @@ static int ds1343_probe(struct spi_device *spi) "unable to request irq for rtc ds1343\n"); } else { device_init_wakeup(&spi->dev, true); - dev_pm_set_wake_irq(&spi->dev, spi->irq); + devm_pm_set_wake_irq(&spi->dev, spi->irq); } } return 0; } -static void ds1343_remove(struct spi_device *spi) -{ - dev_pm_clear_wake_irq(&spi->dev); -} - #ifdef CONFIG_PM_SLEEP static int ds1343_suspend(struct device *dev) @@ -471,7 +466,6 @@ static struct spi_driver ds1343_driver = { .pm = &ds1343_pm, }, .probe = ds1343_probe, - .remove = ds1343_remove, .id_table = ds1343_id, }; From patchwork Fri Jan 3 08:41:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 854980 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2063.outbound.protection.outlook.com [40.107.22.63]) (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 57BEE1D63C9; Fri, 3 Jan 2025 08:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893776; cv=fail; b=fm0TINDTb1KMKKAiGsjorxegtaAQgZ5tqdf4xGW0ZBxoHBOfhREEVy/cOYa7RrSVfRKT2/OBrvUTV2TZ3nZrskbEGKx0qP2ufNCS7HuL0Hb05O5K4sx/X175sWKdGrurr6epLsGyNxejhk8L/FccjCdyE3ZzlXABpi+lCA06fNU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893776; c=relaxed/simple; bh=ZKjmg1MtBFOISkDUMyTeytnGcAdAAATDapDdHX79doQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=OlgU2Beb/MAixrBF9d8CniZOeVEBB56p/yQxmBjhgrDpcodgJu1lmbYfzGpVtJHWS+Yli5n+FM+v51Eq1CKfQHZX6nDR3cM7U+IaNdxij9YSnf0WWsNb9DAtP3ifL4IdusQXirI1Id8crfGLe4R2e4iJKhoMbs90/ZaF4snVcRs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=NtKJBg3E; arc=fail smtp.client-ip=40.107.22.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="NtKJBg3E" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EeC+NfazkdKVsZEXy+eIyBv1r+W/1dFPndPPVEIauj05/h19cguDfpWxoFma3ZSfh7hjuRIiBaN04DBjujwJpaXnmoGxv89bwnzdx/jHce6dqT6M0Dg9VsTkiJCOuXi+PXb31Obbbscj2MqUjnIlKfINgciGhq9trrBsdEQlqUc+/6vdoN3Oy7Oybl+DR0dxQ1+3gseQPTMw2eHdKWP5+YD3cSigB9Yb+gYWB4aLRxi2DR1T5NACJ2IRWthw4OKAXhuAhIvRcL5B5kB4FspUuyHn0XbOgvKW5n50s3O0uXm4I6SnhOkPWucd0wyhap6vmsyWKT8wARhDxYOzbKwdlQ== 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=ukcfnak6rASj1mOqRwYrxQ2oQzH5Bwejo3Xly8lLTrQ=; b=wB29f7EcuCWHP7IQcXJoAd6u/aN0JnFIy/SdSRY6OOQdPkJs041KTCR/djxq16CaBNFb4p9XxvKTrO3t5ecrEpezIn1E3wXc07Czc8d6a6A68I+nGHX56uA5KrwdaBYi9d/r5wqazvIL72FdjMwmzWBWEgVMZriI+K/Z6yqg7eGnzP60NZa1wwofTkSNsiRVVSSWgIa1mop3upWQ0OLt69mPgQUg271EFsAIcaRtAEpuwDY3niosKaVlZ99UpBIxhoNH8atTYAJ/vKic/cA61jM5Of6jxM7wPNboYvhWkOw9tlIjLToo6b9lM73A/+9YsuWhIO/rM5jgrNOxeKCkHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ukcfnak6rASj1mOqRwYrxQ2oQzH5Bwejo3Xly8lLTrQ=; b=NtKJBg3EGttxxA9nZ55BpiDOyMVPOopPHXo2Afp1VKK2bLtQxEI9Rgyd5DeyQK9BGUmWgv16I3by1GR21cVkUbru+2nNIjS47r8tWTWpTg4PLt8oYjTrBYuzW2MT3cAluG/RsZ3uiL06zpZK7w8KSVtvyCdMMS/5Is7YPK8orGn9R3AGtDBDYpUdsBpk3aX8MVdI+KqTouIjnufZyYl9f7czq3fxAD3m3rcmPMlf8jEo9kZmAdOHIA9dQC29rE6Sf5Ikc2MiEH4vLyJZI8gwzhi0/QxF3t+mGIHVz5j0jioxx9vRT7pgmlh5T1q842SgUqJ13aEviRUWSEZ3Z3+S3A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PA4PR04MB7599.eurprd04.prod.outlook.com (2603:10a6:102:ea::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:46 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:46 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:21 +0800 Subject: [PATCH v2 09/12] rtc: pm8xxx: Use devm_pm_set_wake_irq Message-Id: <20250103-wake_irq-v2-9-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1049; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=GvTygPs23OU+WJ4Ssa5ar7+WSYAkUwf2a/2JL3pAL9Y=; b=JPMab25FiuphWW4zg1wpUHsKfC8j4X4PmEXhMG8FlB//Cag8g4nboWS7yj9Rm1f9sO6jqHfMb iu/i03TNnEhDEbRkTdAsJEVEhnN6H6MmGZg2Oh/wuw9wXjT9YcZ2lzK X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PA4PR04MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: 47b8be2a-229a-43b3-2ae0-08dd2bd2985b X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?6DfbLhVCmFgWGOuA7a1bzgkn/7N1GwE?= =?utf-8?q?2QmMKjDu+7B2oyar4IvLmgGLxjehspTOnpbISzCFoLzDCt2laI54cJ1jkCD/ghVyQ?= =?utf-8?q?ZNMbeKceQ7g0e2ROHllMAaP0xJ9qXI+gnAlpUeoa0d8et8G8V+NPf30EJvyHwRS5i?= =?utf-8?q?wWrUGsM+GuWXJnzG8zh4D8DYcTsxaDQcc10mkqsvDp3OLDb1w8qouqS6a5HwlAXIg?= =?utf-8?q?RoRQaCmqDn5D59Myj1LM9s0gSLpi71Shqs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C45m0MJpzgT5jlilMawTBnrEvR4x?= =?utf-8?q?Xfmc2EWcqW5jy5TEQPaGj6nA8QlPn4SqE0p509zOTOuG2YdIi1ZgMZz4IfLsyq723?= =?utf-8?q?PWQTfSQDqDxZTrypQZWqhfKMj3jdrfDItrcTdgKaFjMJvJy+xeaP3JUjQqySzqHUM?= =?utf-8?q?igotidpKgsQ7GqeFV2O/mHEApU3aJACIA3+SkIbBA7ZnL7kbhc/VRYOv9y5WVPCWR?= =?utf-8?q?MFVFL1swl7QM+A7wxfEoALHPYaxve451bTemN4YBrglDjQuVybj2pHqo5X67hRTbe?= =?utf-8?q?iSKg4eZnZbtGnTkCscS22F8vQ9Jh2vr8w=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ovog8oyPhWj9pMbBgNFBCnUTI8aZ?= =?utf-8?q?Y6N0ow0AH/TjpWGzenNq3KhYj98TMe+jgb6of/mWJBA3vmi1+hyXO0ZVk+PtMn6lT?= =?utf-8?q?3yBBlf1qrB9/ttMhVNJmvLS2GYPXqx3eXyhI3WTTXwwKC09KrnKgHtGBuQoMSNsu8?= =?utf-8?q?AabCF1PnX6OWJRAhK0fkzc3wq8cWFT+dpn9N6zqhZ6LG8/Mj9qWSIU2fn+Lyzm4DB?= =?utf-8?q?KNKkXTKspY6EpIyG2rhP/bA9bNKI8Wpp7dcexgDP6YOn0nRlT/46HLFg93XaSvY3L?= =?utf-8?q?CitjutXiNHO61XxQjjRs5K18O0/OHxVOINXRBOjFJ1H+1PobQzy/XX5IkADfjl5Rf?= =?utf-8?q?Rrbh08NgKlz6gBmo3s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XDTPzZdP9MelJwzTi6pM8tsJdgTuIfZH0?= =?utf-8?q?1s9epNqgXGikLYoyZP00D396lKXUHau3kXao0FU3H/x4Db0uOgfgXsVT6EDLinDdo?= =?utf-8?q?y5KhL2lQjGfQW3qqDtuDEQdcy4PLQ/WKNIFkV/9GMxXzyr3Hpc6Pqol43YYbXuqWo?= =?utf-8?q?99tvEjAZqiBt20kidqlDj1FXU9R0xTSjzXiXr/1hFk8eEKqQYRkudPtw6CKDDAwXW?= =?utf-8?q?zOtBUQ0eNOdHo6YEwb+9s1Hp+1YGsE5XPCVd8kxyVuVMsO2cFlnyIotRMBB2M0a38?= =?utf-8?q?Fmdkkg0VT6YK?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47b8be2a-229a-43b3-2ae0-08dd2bd2985b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:46.4576 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: q5Lh40lqSLsdrDSJw2rae9QAHrJbyEHMLWXM7lLzA09cYN8S6y6ee7bR5+SvM7ZYvUMdwDroOR8zAL/Y3whlQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7599 From: Peng Fan Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up. Signed-off-by: Peng Fan --- drivers/rtc/rtc-pm8xxx.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c index 2f32187ecc8d3276a451a317ab83446b7b04ecc8..f1b620b168fcca8c640e4beaaf7e8c17776c5ed9 100644 --- a/drivers/rtc/rtc-pm8xxx.c +++ b/drivers/rtc/rtc-pm8xxx.c @@ -523,21 +523,11 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev) if (rc) return rc; - rc = dev_pm_set_wake_irq(&pdev->dev, rtc_dd->alarm_irq); - if (rc) - return rc; - - return 0; -} - -static void pm8xxx_remove(struct platform_device *pdev) -{ - dev_pm_clear_wake_irq(&pdev->dev); + return devm_pm_set_wake_irq(&pdev->dev, rtc_dd->alarm_irq); } static struct platform_driver pm8xxx_rtc_driver = { .probe = pm8xxx_rtc_probe, - .remove = pm8xxx_remove, .driver = { .name = "rtc-pm8xxx", .of_match_table = pm8xxx_id_table, From patchwork Fri Jan 3 08:41:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 855125 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2057.outbound.protection.outlook.com [40.107.20.57]) (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 899911D364C; Fri, 3 Jan 2025 08:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893780; cv=fail; b=IqvxlOrSBw4qmO1pvAaqNuS55uP6Ph/OSfjp3RNgG/yEhU2JfaPdFzLZwIcG3jgVyPhypPTNH+XuraWX8tUpjw5FsDOoEpDeQ4Hd1ZL/zjcubH0sGbEHuxC9BsuHFdtp3vYQsJEqTcF9IiffhsF+6Fg5nYbUbuO7yYuyNQLcNuc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893780; c=relaxed/simple; bh=gHY2BHYvxVzRpPgRTgubI5fi64I6Ubu6MUDTYIfuE+U=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=RFKqQQTOjhuQOgFF/d/GhLS/S0kxC2HKjdw29AZ09nbLE1Lam6emhr04O1lw7l7NfqoSqY6QpVGWrSWdgqEvlFPEV617XsXB9nT7a8qrLQYV7GWQ+GKllK91vfjy8BoJagsY0TCQetEiXq1zwTXwAuICio8oGCm8bXLsez/aBss= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=rk6kpXg0; arc=fail smtp.client-ip=40.107.20.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="rk6kpXg0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Md4A0Ls1ch7WKaYvjrmUH8MtpM5feWLHNXE5kVDeHYgnNZrgL4gjrJP6rU82LxzViMnBey/0PtSq2aXc+Lau+KC6ze+UEKEdy3x9CPfHkpDUD9yU5syIK/WIiUDm5gXOGXdvuNcNvrGdwX4Be7W+s++NXN/0upTVk0uyBT9IxLjV4wIBrDXumBrao/qW4HtDgYToyB5D/zSN1unrAMJSnvwOfMjtDEwQFRDpAT9R2bQZD6YuX/r2azSXYhinG0nisu6Gb3E2/m7T+0/X762y4KR12KW7rIK9LS2b2LMKWAj9+fQEoN4doRQTc/0zWBffHjmZ9VUFMIs47twkTrCdIA== 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=XjUzsRVsWfUKGqcMfcInIdzIFU4EDALwy1w62++QsnY=; b=NNyLgFPlTYgh8Khp4SfPZnGrCwaurFZMGzo5PMIBgbrV/vUGgsFS6GjKniBd6v9xYKLN19f3qAxqPH7850qCpr17fWCneAQFTRiqmHhmkYG2/1gk1zrF6mE1tWYkmtHSHQdsHR1Y7k/xx6PEoIp2llHMBn9cMFdiBxo6RdKVoq4XebnBCOfsbuRD56WUv+NcYaMxv1hiv0/Wvfibjwf0nqQB+10vadmzcEs2UOalC4jtPvthc6/sFo9BmPNQJX2OjaUayCMjm5iedj3I9A8dF1lt4sFb7vdId+Wp5XaV+9V+G8Kjy6bTCHM3TLTEHMacbcQDRjv0VLDRRtHV7ZCIfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XjUzsRVsWfUKGqcMfcInIdzIFU4EDALwy1w62++QsnY=; b=rk6kpXg0jJzsrvHsjOIt/T91wiNyt7KcPzFMabciOPVCuo8zwckPgPfWCU3nYbNtuVyGmAT4CV7feR7EigFGLZvXRa9yWB3ZG2/REEXkAo+IY6xRQkBsiLL2PVG6pqVAdBljO6lfUCdu4bJLsjnQnCkTgh/KrO70q5Ac67GMZdzqBzVkO8qIWrh1D8+zMZQB5jxppH4AF3gizJxUFCrCtmXPJC51RUMcGlydsuGrL3CsmSJrmTCtc4XRvq0YqwfABPXYfvkaZbJn7yoQ+mMvn1k6q5zEj4851UHFlwcW37dlnSfj9PL8xBoBVSmkNiJgBaHEbOXmkxY2uybvddWBhA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PA4PR04MB7599.eurprd04.prod.outlook.com (2603:10a6:102:ea::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:51 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:51 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:22 +0800 Subject: [PATCH v2 10/12] rtc: ab8500: Use resource managed API to simplify code Message-Id: <20250103-wake_irq-v2-10-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1597; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=rISyYCuz8yJRuvtcynWqye8n/ybIJ7leHy6yEB7pHHU=; b=xaSOBF7rbPCPOPpRk8B72PtGMEon0vCPZFSnnNt5H6V3KsWLbwrLyvuss/Olw4WIEYNlzcdnV X7R5cOLpQU1By5c59CRK+xFOdl3nMqOGeDn4fIgj1jykTG6IMhvHt0D X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PA4PR04MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b3111a9-45d3-429d-94b0-08dd2bd29c03 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|7053199007|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?p6q1ULLPpXtH0S+2nbkrlk24uoj6e2c?= =?utf-8?q?MukYyzvk6K38fq/HSzi3m8CAYadfypCfq89BAHRUSrrt5HfDHW4UlT27NJSXuuMik?= =?utf-8?q?XPzNPwDHaLNu92584g7V9tfmod+KRxIOgBv5X8RH7mxVCo5dr9dl7ExLIcjgzb1WZ?= =?utf-8?q?DXBFmQSw+zNpFN9RNxKJdJP/7X4gt2AyI7GRL8AEfuKV+k9iy6iq+aKr9JgpTBAXB?= =?utf-8?q?vxwRbkvMkY56u/qlpFSdTubzrzew83Dap/uDFjVt5uxbFzPR/AUwZhSWO6vGJPNFu?= =?utf-8?q?NavWqTzyU82ZJxxEFr9pZPqmrEU2Fs/Gas+9DzsoDoQbHZWINXHyqACsMpxT5Q/GI?= =?utf-8?q?GoB78Lo5/LNiUCMAc780CIXWbDcxs5TPcRbsacJobeS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owV+R2ul?= =?utf-8?q?opv7GbO1KawiJz24pTFECcCqt8uMG5F2AkUiVi6ec6C2LsElmJ+hzOmu5xPT8Qc++?= =?utf-8?q?TsroXSfr7ZLlkMbJwjyoaNCrnraUDvH//9j3gHPQYw/z7O5a3s2MG/TJeyxUQ0h4T?= =?utf-8?q?SjlhZ3v26TJM57oSV9I+u1vgk/wL9dvWg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(7053199007)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?XAsV0Hq1zdd9jNKOwgi89CioBYAs?= =?utf-8?q?AxW19XNVWjjUSbSt0n2JSa142jXPgek4u3vWlWIr2DK4Wyzec4gbnR8CvHR5ogmv3?= =?utf-8?q?68/F+YgFLIGGVILq1Xumha8QHxtYvlYK/AqZ/oKAfK73r1KzF0Cs+AfGLKVMocxcn?= =?utf-8?q?HgXKI+vQPvYgwgb9n923ckqtdsHkqXlVjd1EAmuq5hBx3CZTEfPLQVaQg1t4SAhGm?= =?utf-8?q?bSQ1UJhoQ2tTkdf/WiEkxeFIpRS3ybp8vWh7CT9aMyiStadC9LNeGiuIQpCTzaoUL?= =?utf-8?q?W9QJ8GcE2oddEGiRzCnIwxPo9iVZFyPA8eAHU4sLM0liwh6efCIDx0unE6v/d8uCl?= =?utf-8?q?I5/AuV4K2w684V+65HBXdNUj7ZByGYkUu+PInlpvG/f2/Q0dbkShmPUmqx1baGwSu?= =?utf-8?q?FcgbGoq4iMl7v+Luq9UUpnhP6BHy1nF8hQXNpsdidbw7FFpzyhqML8BC4VzKtwkx0?= =?utf-8?q?i0fRCD5XXErIsojcskOQMdw1bnirYd/K+B1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TLqwVfAy2SCDloa5Gr1V?= =?utf-8?q?R/r7eQwLj4pLQLCGrjVMoXmT11hWr2t5s63+Q3c0aXSwgh+XEbTjphUgH8drJifp7?= =?utf-8?q?ReFO1cr2BlQi8l6UDT2Q6T9a8et6i9RYVOe4rjiy7ujt2iaNEQr2UR42GJwqhDUlt?= =?utf-8?q?dIbwRZuHKbGj?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b3111a9-45d3-429d-94b0-08dd2bd29c03 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:51.8042 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eBccr9Kg0zcivnKXlfIPzpufRiqn5RmXhVbU1IS84DVazBkSZe0kenEoQGKBxhRunqXQ2eAyxyPagxi6XvIKGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7599 From: Peng Fan Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the error handling code and 'driver.remove()' hook. Reviewed-by: Linus Walleij Signed-off-by: Peng Fan --- drivers/rtc/rtc-ab8500.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c index 2dcda96f4a8ef727514c751322b84d8d2b382b75..ed2b6b8bb3bf8f99fef9f8bee9676f71f8a86d2a 100644 --- a/drivers/rtc/rtc-ab8500.c +++ b/drivers/rtc/rtc-ab8500.c @@ -361,7 +361,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev) return -ENODEV; } - device_init_wakeup(&pdev->dev, true); + devm_device_init_wakeup(&pdev->dev); rtc = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(rtc)) @@ -375,7 +375,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev) if (err < 0) return err; - dev_pm_set_wake_irq(&pdev->dev, irq); + devm_pm_set_wake_irq(&pdev->dev, irq); platform_set_drvdata(pdev, rtc); set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->features); @@ -392,18 +392,11 @@ static int ab8500_rtc_probe(struct platform_device *pdev) return devm_rtc_register_device(rtc); } -static void ab8500_rtc_remove(struct platform_device *pdev) -{ - dev_pm_clear_wake_irq(&pdev->dev); - device_init_wakeup(&pdev->dev, false); -} - static struct platform_driver ab8500_rtc_driver = { .driver = { .name = "ab8500-rtc", }, .probe = ab8500_rtc_probe, - .remove = ab8500_rtc_remove, .id_table = ab85xx_rtc_ids, }; From patchwork Fri Jan 3 08:41:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 854979 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2086.outbound.protection.outlook.com [40.107.241.86]) (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 37CE11CEAC6; Fri, 3 Jan 2025 08:43:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893786; cv=fail; b=Tmz/QGpv+q+fJASSnhNqb2UcP3nnCCaranZtyDxQeiZ7Zr3205cFrOumUpLG1Lgmx2YwmrurEEDw2nL3FiaXUppNUXAJJ2VsOadp9RHGDQgO5zXwrdBIb1njZ9hlpCtKAx0svk8ALKCir5SyfvAxOPtWDyYBuzy2+i+PvF58gx0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893786; c=relaxed/simple; bh=/EC8zCoNiyDgYUl3GWxR1c0E1R02p9BWvo/Wx1hJgus=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=jJpYjHWtxzIzbKs80usLAC4llMmXJS5OgVtRWAjkj31AwHlrcpxFeWyIgyIOOwde18wyTK6J2Yq4ZWouyTa3HSDls6vbl86DHoArtJXLVOeHlw3ucC30tIPXfCCDQDG054aMOjVwVQSMPjEcfTfRlY+9P/F86pyakJk5zDaO+fM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=fdyth0dH; arc=fail smtp.client-ip=40.107.241.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="fdyth0dH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=agKHHPyfrGCfx1/RmupgmGQhMk0tyWaM3hP+kHcOKnIvGBYN7pFNiq+1Dnll3ulGM7oH35XMgZQ+JpkCxcIS+bDxUMx5pZTDMl8rAwIIfrOPO8fHFyDdp2jys6TR/nlW943GEGzS2tC7q3bfeoEOhKwkz8KS5bucUQly9JjNttzb+HFIz/emWfl1OYabuafAr55aDwyUfsGzrXqB0yAV2620xj/cRLAfoeOHlb/vWvAQl7tE9js9DxlROY3sYs8aCSCvPuQ080pMR7dUxbtlg+iGMP25teToCT9rSU/eBw2OuoungZKYxx02CjmgFatIDiT8EcdelIesFZMdm7UAVw== 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=SsAJU3FUgsUM88m4mSGw1WR2K15UVHFt8h4YUCR7Im8=; b=KFWpXpecfbdDklWKQJShAadsHNCAfzS9k0xlz2emBIuTFumYWd6TriMe2U69HspmGoyreD5bxVZeq4BwoaKD9yQukeFDqOtYIWp7sMCyBvjJs9KUmXHKs1z9+ULYt3Fuv1F53USMx/jxdqCxLdy7NbgGqTeEM6787vqP8D4NSQgy7qQS5jB3gKi1AT2yEKsDEEzPy2JoicGcD67eihqYB+MV1DwTgawRb4LtLM8+A/oX2ejzI1fBhFi9OxNyrKkj0GM3gefxWeLULh4Mky3jBMWsHaOjt1yVFv9KiIKWXe74vUa6b7iLnYC+CrAPx7vXxAUFKlAgIFj3MpTzjno6lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SsAJU3FUgsUM88m4mSGw1WR2K15UVHFt8h4YUCR7Im8=; b=fdyth0dHKKfYgg5y0izdeQ9GTx/ypIiXzeY+cFZrLQMyvN2DqlvMKanwSi/AY5eM8h+P1pxMVrPeo1LoQiIdGzYUdBmP2801/p0o3cSX30JqGzNu87oE7gwYo4HCQAn4Ooh1T/uN8Epb39nrRoNSLXxqiLF1NZf8oA8YDWAZeIRuTeJEkvOKmYifR3zyLwjsujqW73ZBw6fRFcEo6T5BDZWU8DZvhnGEPM94RE+fHgBwuz09+u+3VZ9MCTTp4smx8QoSQYAnTaxkwlTHj9spuE28Eb3Ot4fG1wdN7YpWmAQER75UcUa7ZVAZ0KjH5bZaueS9U/1Q6gdgB/4r2Kw3BA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PA4PR04MB7599.eurprd04.prod.outlook.com (2603:10a6:102:ea::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:42:57 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:42:57 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:23 +0800 Subject: [PATCH v2 11/12] rtc: mpfs: Use devm_pm_set_wake_irq Message-Id: <20250103-wake_irq-v2-11-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1347; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=7sZhYfT/a75JkuPsULgAYPAtV5pnc5lWQRqy0mNIenc=; b=pqdku+mazAjUpAScAyFxwTXob9j8RqYQyx11Y5TT6Khed5JfepTp0XYtWnVT8pAuswCVWDRMT m0ycP6frFQfBnZK6G/n8bGNw81H3gFP7Ep6EZzK7MuASSSJ+fCzeR3+ X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PA4PR04MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e6d6526-2acb-423c-4460-08dd2bd29f2e X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?dXMPOlgsVzN+p6FIojtGUpAPQ3W302X?= =?utf-8?q?1XW6mHHAn/7uIOyE1dihHo4cHgAf8bWkKTAx79PuPiXE0PRCHzWNf+A/uux9NKA4L?= =?utf-8?q?maS8dcWGEBvS6h5CNsDBd74diihI+UxX1BgmGPMqt9yzm0QdZHmecwqD3swJyUL/A?= =?utf-8?q?VE316ZmU7Q46/bm5/0hMNhyNS0Q0Teeh5TMppzJTu1VxSnkf0NzXh8mKpZzpOs8oT?= =?utf-8?q?UTKIPIR1AtHO2L9sX99FIC6hECrWZpqRe8bgqtGoLe99H8I5l8ay7sLJrXLCyaErw?= =?utf-8?q?hfuQuMea5dhP8E6CU/Ba5GN+wH/GldomlWVuadDds+T7FYAPIEkw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PiTTqHHttpTo?= =?utf-8?q?/fYaiTzs14EaWNqAw3ANmPIXEnGATPaQ42LSXInT6oeqd8Pkss/75b8cuNcbmvchA?= =?utf-8?q?+15En3HRjaqw5cwZZSe3oBv4sDWOF6On1F1yvQm5MKEYozU019AfsEAUAUTUJ1iQH?= =?utf-8?q?QTNh2DtEuM4n/PiwbE0DNWElojqoeDO+O4O+A1bNJJrD4CY0B3ohSyyLTOvTnvazf?= =?utf-8?q?RzT730kOpAhwGFNHHpmYfNgqnbnhJkb/w=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?vcytUb16kEWuXHijrmukdgWXN370?= =?utf-8?q?TH4pJDmPgDFBTcCYlG8OJPmuLLdWbKzolTMdo7s/c76E0seypRZtsw8QHANh74mmr?= =?utf-8?q?erkhmOGNJiqakq2M50BMS7tmzWE1b73J9/XvNktXkugO01YPd7AO2uwPwPCs1n+p6?= =?utf-8?q?yC2uYmvBp6iVuBj4HLesWvUJCb+2Z/dRe8mGo8fVMgK2SM1ghad5+cnIt6gqD6/GJ?= =?utf-8?q?YzhWBmmYnOv2r3gzx8z41dAobhvhKq4GLoxk3Z9PmTtvlQEBvaqDvHL4W//5jXxxi?= =?utf-8?q?c2SzCSkCwkNjZDoAJKPLPS1VSlwzkWnkeAftX9Ou6F0lJwd2X7yM+Tg2msNZzVwzF?= =?utf-8?q?1Ug6792IzEeEz6wGHRPgIQdcZr0JRwZEj9joWb2SNk+hkQK2sVRsiUOwylO3nCRPu?= =?utf-8?q?5PmwdXE6oiqYYjd/9bxIXt4l+dxvkJT9etZLLxLnnJ8f9p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GY4omdgBI1PtOambH7UoEACe+caqxtLhoLg?= =?utf-8?q?oLUsVBRiu2dbmrQIQPqBhaqfh/Pq0DrUxc5nt+32+D9JwglOAc3kTiP+csSYeF00Z?= =?utf-8?q?6EWW9lnQGsDndcFHGLqze+atgJCGjqBvFVe/PfqTri7qIl34PebXwgOepO7hDaZSj?= =?utf-8?q?H2ExLLXe9pu1TdUUUNS39gMBBt/dRh6ACk69Je7V9/YfmFTdN613k5ZtZ35/zwxY8?= =?utf-8?q?fL2CpdWxawcy?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e6d6526-2acb-423c-4460-08dd2bd29f2e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:42:57.1509 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AcKLnmumH38JFy6B8vQngVlbJeSSXnBV/m/ezhoyeuG+wTQhYa9/o71OXmuHdzKAKu3z/v7ZoBqFSAZUJjf9WA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7599 From: Peng Fan Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up. Signed-off-by: Peng Fan --- drivers/rtc/rtc-mpfs.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/rtc/rtc-mpfs.c b/drivers/rtc/rtc-mpfs.c index 3892b0f9917fa7bc4f732cfe2c2b2f548ba7429f..5a38649cbd43b3c6f2fec5db95c4f0013deb2a08 100644 --- a/drivers/rtc/rtc-mpfs.c +++ b/drivers/rtc/rtc-mpfs.c @@ -267,18 +267,13 @@ static int mpfs_rtc_probe(struct platform_device *pdev) dev_info(&pdev->dev, "prescaler set to: %lu\n", prescaler); device_init_wakeup(&pdev->dev, true); - ret = dev_pm_set_wake_irq(&pdev->dev, wakeup_irq); + ret = devm_pm_set_wake_irq(&pdev->dev, wakeup_irq); if (ret) dev_err(&pdev->dev, "failed to enable irq wake\n"); return devm_rtc_register_device(rtcdev->rtc); } -static void mpfs_rtc_remove(struct platform_device *pdev) -{ - dev_pm_clear_wake_irq(&pdev->dev); -} - static const struct of_device_id mpfs_rtc_of_match[] = { { .compatible = "microchip,mpfs-rtc" }, { } @@ -288,7 +283,6 @@ MODULE_DEVICE_TABLE(of, mpfs_rtc_of_match); static struct platform_driver mpfs_rtc_driver = { .probe = mpfs_rtc_probe, - .remove = mpfs_rtc_remove, .driver = { .name = "mpfs_rtc", .of_match_table = mpfs_rtc_of_match, From patchwork Fri Jan 3 08:41:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 855124 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2068.outbound.protection.outlook.com [40.107.20.68]) (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 4C34E1D4339; Fri, 3 Jan 2025 08:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893792; cv=fail; b=lRPLQ+lBWc8H5k6URjWlPGzxgGsNP7PzunQS1tgWVs+3Pmyua+r0ZsqjQ/AQNCw8rYFvEOwTp9FysrM+RjloEdZqSM9ZD1Nxmurp0DB1YEWoYmSrR3o77UzEKvAcDb8NG29f9oWSgW5YDWtOoEEWD0YOID4SLcq6ioP6lE/n1rc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735893792; c=relaxed/simple; bh=AcWk+DTl4vJlEoX1Fz1L2UUCItL1uFcWaPK5Bz+U1lU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=OOfFHxLxeq2nEqB1FEH4rFJBg0Ra345pVbbP98BkUIGm6p6h4IA2WeYxr58xNEb7pTbbegfl6r3HGzYCYVuARAsJtwlHwnJP8n37Brn1OY1M72IAw9GPzgMTbTa/mvXyyFYOPdMZpKotiTm+kEasQwkSz+xPA4u9o5zjenD2+AI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=vxTtPFsk; arc=fail smtp.client-ip=40.107.20.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="vxTtPFsk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zQWhPDj1ofOw6tAbwxQfq8y7SsMShquk/MtqtByTVkNA9Vc9pVvpZpP8Z6YJJv4bSZXruHE7oWL5E4dzNaVdYbobLU1yxv4nW/Dfx9K3RepTJcqJMdS0YHcPFfuoXlxm2/c3mE5aC6phLfiYB2yavJR/nYbBRLZ9RdgbviTSooASvh+KW0lGgd6/xq83zxTaR2Bm3eDbNa57Rl4fWlOjXTMphnBVcoy8WeO8w90u4Ouu/n2uEoLtx7Mpp6BS4xNeFZLIGT+1CJ2ihrqTqpnKMHJa6BXGCF+ZEFHCsnGIWAp6QwIi6H7h3No8CkrpgFzYZZxIbzq3Tbx5C4BwfC55EA== 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=EwjZqLy9UAzAbl6jmLkoboiwEpYZWe0ARcy3BM/gy6g=; b=Ls1klEqDwOGqx+74HAzT8Q09y30G/aIXIA51Dkpc7iF09f18N16idakmdNhFM2Z/v6m342eFUMk2ML2f4saShR7xUgaeeujzH6q5M7lpgBFlKbMcFdRpjFgFv2TbD+anH0PZEvCKF9Pa56kSNcsLahu3FgS6n4fDAHP0HYglbC5q1RAr9CaG9zuTjrWmDnynvQzXeUh6s+tVa4fO5ooOyquSNvk3zD0ejj1YkTMKe8kZ9NeaHgmRfmScmsu56haPpBScnTc5ZIbtwTa4IthVBL+f4ZTcqT1olC/ZwKfT5eSxVXifGAZ3AKvNkPtbRmFPHe75pnlfdOKRJ3/ucmC8Ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EwjZqLy9UAzAbl6jmLkoboiwEpYZWe0ARcy3BM/gy6g=; b=vxTtPFskRMLEgHTyP/fgpcXoOnZE1EqlrYdZ2rMxNKdrjgULKw6PTiA0yxz3Uw/Bxxfmqg7Q8Q+D+JkkbClTC80gWGg0rdgqcIBvWqzD+Q7+R+/igdZgIU/OyKxyP+/wCOKnFCpoX3VY6brTJX0PM7bQ0bpxZK6tnj0rkNjKQ/kYhoCXxbWB0fqzaKPw8iv62R3HUYewE5VbJQekz/9REa1wkAqJhmccyUcrCSVBpF+C5Dq7NUpZ7ulQgUVrXw8w8+le7flSPCKKtNZmmaNT2hz1t4rM4yyN6rX9RCu+QfbAgPprYFeSk01dpoKE2dT0Dq7DwJIuUSLtu8dXblVBEg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by PA4PR04MB7599.eurprd04.prod.outlook.com (2603:10a6:102:ea::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 08:43:02 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 08:43:02 +0000 From: "Peng Fan (OSS)" Date: Fri, 03 Jan 2025 16:41:24 +0800 Subject: [PATCH v2 12/12] rtc: pl031: Use resource managed API to simplify code Message-Id: <20250103-wake_irq-v2-12-e3aeff5e9966@nxp.com> References: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> In-Reply-To: <20250103-wake_irq-v2-0-e3aeff5e9966@nxp.com> To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Dmitry Torokhov , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Linus Walleij , Conor Dooley , Daire McNamara Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-riscv@lists.infradead.org, Peng Fan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1735893689; l=1457; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=836X+TA/l2wfm7yon8oTf/+NEC4So+0tkKKh8ZKoqD0=; b=wPNPC7HHmF7S3u6pMjmQqPHx6RwH3WIKfRhJYkNt9qByWhu1R+qotgzVAjq/sEWPG4hhwi942 RKN2EzFG34NA0T/RCWXd5Lugy7TNOKAcYWyHlzqRweLvVc2ZyR8wknu X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0003.apcprd02.prod.outlook.com (2603:1096:4:194::13) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|PA4PR04MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: 89a94550-10e6-4f5c-c545-08dd2bd2a28c X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|52116014|366016|1800799024|921020|7053199007|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?ZAsfk1pBxUfLIT6FyInRtBA5HGURY0s?= =?utf-8?q?H+6yMjD73/IYn22E0nP5cGrBpZryXgGuFmecSLwIWglDLIRHCUKqmIzYvJr0bo5S6?= =?utf-8?q?QZfW3ipLbGupHZVnz7mSufj1K/sbzkkjKFCacV5H8snZWLRtwf5CE6/jfM8hOqkRA?= =?utf-8?q?pCvF/w2iQS47wjN4WUQL3lHS40riI7hCTN6iNlo3C+/HCeNxpBTFIrQSAvZHVvkV7?= =?utf-8?q?YFuVPeBZ9qNKAdWnhlU76mLxWKXJ/IWlqyEEnPr+Kp7Boyzc4fx0cL0HtGRl7MMie?= =?utf-8?q?BfxMYJv3f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4VqU1ASQnLKnOdSWl6UTMsVLlU5i1myu7dGYUDedsd/bPxY/S?= =?utf-8?q?s1w07BXoDGSeHu1eIUo4OKWXpQVOj3KbX1lBvTFR4fwxdJgHPzPDnJ0Aj8xr4eUj7?= =?utf-8?q?i9/oyNgqJxPg6/HZKlJMK5pbTyFRsr1UnV4Xj1BvnbKcM4X5/QqScss7MzcGyjMmj?= =?utf-8?q?ritNCsHuPo4NPA8kSAovSNGacXWh235qU68cVfKpNcggH5ACpCLdfcj2vBPl06J3Q?= =?utf-8?q?BEfK+UQaF+MI9GAbjSvEwhb9/1r+Vb8AQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8459.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(7416014)(52116014)(366016)(1800799024)(921020)(7053199007)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?hi/zFiMZUusTZvnHTjxmIdWPajNp?= =?utf-8?q?USCiCYtciDRRHe7e97rki+NIhB7EWV3y9N7nIcz/SSWxh0hOuJ10lGE6iZesP3c6d?= =?utf-8?q?l+dt4cuXbYCEz5Wby6w7YVIQMTaMLJ1zxfJ4zUllxYVOrpgGfE+OS9CmHxG4uq77o?= =?utf-8?q?AdLska/fTt4YrYpT68d4oGXK8TIClSzZ/Ac9X/eQUqD9F24x0xYPN2cOGz/QdRJmQ?= =?utf-8?q?61P/QKxjNeDF4DHpnu27V0XMiJsXEiywCCoHO5auuFpXu0fz69mjJ4Ot8TkLw1uef?= =?utf-8?q?jzzfVGxYKId9PHxrLKPnIPcEXzNQGN6e4R+k/sDG5BJgImmIiASmT/EYPmQEBAfN5?= =?utf-8?q?p9+bNbilC1pf6zmGNZlIKUGt2gwN21fdq7UGeBgW7s0lu/uuTkPLJybvNy2/V0zOS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utf-8?q?k3pBnka3kLIt2tP+tnQghYpWnIRpzpnjHXZxuIyEXPap6N17vKsIs9eTr2CGX6p4f?= =?utf-8?q?c+in6ojgOeyc4pwQzKawbeaN6xihXZ90BqhBrR/VeslJn/gvLAliHNjSiA3vaop3W?= =?utf-8?q?jT5ZUQRSlEbMjQkSro62sN9GecPWMRldN/GL9cNShfEO69O2ycMDhgSHQW9yvA7oR?= =?utf-8?q?9geGxlIByeARGwuFWPnLqV73F8cKK+prSb0fHFD+IE7AhdyCJcLjIpLBTuQ/8LPSK?= =?utf-8?q?kHrCC+Q6wSK3?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89a94550-10e6-4f5c-c545-08dd2bd2a28c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 08:43:02.8080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vbRkWz8ZpFt7a5nsJBlpqqRsT9miE424tJjzPiFVpLHNJKjBfmnaampVFv6MfS9OdqFC6I3d4BehT/R/OnDJfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7599 From: Peng Fan Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the error handling code and 'driver.remove()' hook. Reviewed-by: Linus Walleij Signed-off-by: Peng Fan --- drivers/rtc/rtc-pl031.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index bad6a5d9c6839ca70905e3d46286b9729c1fd435..47bfc5395e5908b7722b98276399120f1ba65af0 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -284,8 +284,6 @@ static void pl031_remove(struct amba_device *adev) { struct pl031_local *ldata = dev_get_drvdata(&adev->dev); - dev_pm_clear_wake_irq(&adev->dev); - device_init_wakeup(&adev->dev, false); if (adev->irq[0]) free_irq(adev->irq[0], ldata); amba_release_regions(adev); @@ -350,7 +348,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) } } - device_init_wakeup(&adev->dev, true); + devm_device_init_wakeup(&adev->dev); ldata->rtc = devm_rtc_allocate_device(&adev->dev); if (IS_ERR(ldata->rtc)) { ret = PTR_ERR(ldata->rtc); @@ -373,7 +371,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) vendor->irqflags, "rtc-pl031", ldata); if (ret) goto out; - dev_pm_set_wake_irq(&adev->dev, adev->irq[0]); + devm_pm_set_wake_irq(&adev->dev, adev->irq[0]); } return 0;