From patchwork Sat Dec 28 01:14:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 39694E7718B for ; Sat, 28 Dec 2024 01:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=u/zHiXHGzLT0luuezzbyNEzAVvay/MOvR8AuTlEFGyc=; b=pHJeMphIJwtzTkiDG0qbp1iiNm 4JrIHJrCAmEfXIaJLrxTSF9dZVMgx1iVpXGO54lXeDLEFYiypad+kjX2Osi1gXzkArAQ5aNbBrOCU oFHtWmPg5752Ej4kgJTP92+kKFydXi1NQgUNmq30HV73HoxlQrsUu/pbYs/7sOrx+nBtdpb8/TtZA VtAZv09d+usnNmRsevbARZpOQNInEe9mvPnDx74J1xDUXwSBxeOVz/L9wnhkczbk1x3CiWBSvR/lF 3UmvNf6zaUeBq1xNl6vk/lH6EoPuozqeMROB2YPEPfpptAV1TrCc831fMgyocUTdk3T3YcvDdWk8K D4AhGo7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLSk-00000001Bio-1oa1; Sat, 28 Dec 2024 01:17:54 +0000 Received: from mail-vi1eur02on20609.outbound.protection.outlook.com ([2a01:111:f403:2607::609] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLQN-00000001B6K-06sQ; Sat, 28 Dec 2024 01:15:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gVpIBXKGDph7VANcYk4QJZCn4EzewIx7bvYcluc4SZR5svnbJ0byeNPfVc8L9XkqXmlMcYWuzf0/8wARB3oW2cZHpkwL3MYL6g3TsGloe+qFcV1PHpIG3CLqV3n5CRd5xIif53z3VyIR7DcnssS23ma8FwDifqIJVaa8xlV3JUXi0vk0p4ea7GrcXLoV+362g6FJAcjsfezHTEmwNZ2s4emGJ7M4sVEzGffZ+TB4yizfbAKPRtyLBRVC2jt++4yER9QeXh16X0x+L/it5fUF9Du8oofLo6BpzUBNezkEnw2vBxmzkP48/juiOvrr9mQ9LwshaRweIv4Z/CUon/A7HQ== 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=LXYTp5BoecHg34e+obK9OingrwQWYhGlKmIRTdHjAGw=; b=A81C6fyc7AIg6W2VB5Vw2VbkwxT/TP+PuzuiH18mOJEeR4aHmcMpv9E18WxYob1Yfv+n3UUO+CUqoCLR2xtEVhAnX74Pqkbl7943MofP2Nsavh2wPcuMA80frFnCMhqEdeudC4P1u3ivSNyreD3uz3Xqvh/Dz3BVZxPfK+6+3TYjBS36UygZRwRo261CwcyJiChWgSaxLcKbUZngsRoEJaBHJbeJgc23U9QGEKMbZZtep7b/MR0xRfdPa5ttvbjt+C5kIa+adSXMcRbkAdsqQUv4Ph0/AKfXAttDK/DpWwfV5hbbAaT6Tmkv7DupfUgzr2K46WbhoYWp9blklWLkwg== 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=LXYTp5BoecHg34e+obK9OingrwQWYhGlKmIRTdHjAGw=; b=G//0vpngaurqRXrrBO8WtE6q50Gf80d3sz9sYm49MRZdJnU6xl8jFew+90FA3J/eKinN9+jsoZZlXXeHOY8aSG7RVYUdsWt4khMMnFk3aPi1uuoZjOHP6aK2xk6/NYW+x/MK/My23b9gDy2DEhys8LJHWofjNotD+kzjXqJp1ffMUi6htbEgpYFbTHVDOwuKscyJaj+EYRuMuJkOmV3cGbgKjsaFU/7VigC9cwdFgSfu0jb3PIOblh/01023p/CMQzr5afYJ16oOd5rTku+GGbvzJWBY7h/royKHBJBwcH6s3EhI947lqokEQaJV/v8iqrWlsmQu4mdrTRBECS4MTg== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15: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.8293.000; Sat, 28 Dec 2024 01:15:18 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:37 +0800 Subject: [PATCH 01/12] PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq Message-Id: <20241228-wake_irq-v1-1-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=2367; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=1uWzLxz0ETkHUyA0IoSi0XaXoYut2vJxQmLJwOorGBk=; b=qSMQnYyGM9tDfzHYkMUGmXNyaUzaGa3+ti6BAH9c9FzUsXHbRHcqUk+iAcM38J1RjL8RaqoVX 5f/l7EkwTGjALGnbsV+r7vQCvfEhAsFjc2BLLoZCeIs1xuYV04uru6q X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 78ae5531-0393-418c-85f7-08dd26dd1779 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?iw2H2/5LxEvQTdhgFpBNQvR1kkaHZ2S?= =?utf-8?q?UoXgSOmuB02HBKxIwq2aNjfmPbDtgHDVHFVzd/+o8YhDT2uQtEEIClRPenb1to92+?= =?utf-8?q?SsdujO2MR6u1OpAwPlFQSR0EEH7xsas2ZZujBY+ehYjrFAUGHIVirM9fwSp96pk9B?= =?utf-8?q?z/RydD/4D6WAcA5/jVRD71o49tp+AS4wsZkT4r2m6XSx/14lInlzC8HsSruQl1VJd?= =?utf-8?q?+Fb/sqp1dSem02qXVgE+xfRL0q8gbDa08kjscNWxhtk1H1vShZh7vKUTOorDXjuEN?= =?utf-8?q?/xzeQ0NrfrnfW2gXVx1ZHU3eKP0Pk9LHTPgOqZoykGpcShW4IsRbvMEp3pSwQB/Xb?= =?utf-8?q?MExGcUhZkxv7me4t5Q1n0DRwnUJ0b/ctJjpMcHp4BJoP60l9++Dr1A31tbws0mR2p?= =?utf-8?q?CqlnrZgVcspAZXGqBGGAnntashgrah0cYAuI45p+Nzjv3knwUKMc3Uc5anzZ7J7uK?= =?utf-8?q?beOHspl0kSC4E8Yc8WO+Cxhp09ngV5pqkvQ5GQDsIq+QGCYa50qJJcfQODwcCTQQs?= =?utf-8?q?g1sMzy7NQhPOgST7nooFlXDHy+On4UUaEagG0otm/n+PsicIfWKkVIO52mvxBThzS?= =?utf-8?q?1U6YthGsst2AyyHiC59ohRpy1BkY7bH+poEDQ8OEbgVR7g3dB1VCowbmPNqCgJ44a?= =?utf-8?q?TmIhoN83jSDt3+xd1sp0qUo+jMWTh59BRFnYfrxcAVzw4L2g9l2HQO0FuZxU10ffM?= =?utf-8?q?/H6NTwfi4cW3xaCFXMfRWs1Tw7hegqYC/Ugo22l1Freu0rLzJgBXHeiclYJUMccRp?= =?utf-8?q?gCoqW7EndkHHmgrnA/lQFTAACAt3VJkGnfSZ6CV7KpXrZ0dWnTmeSR/BjSZ1AQRyp?= =?utf-8?q?plm7n9poI0jdbMQmaH9goQU7AB5lUwjE1jCrZ/e12p4Ct27q1A1JK+Q1py8GBwGmr?= =?utf-8?q?Z0rHbYN904bF9kKkfdABD/ZKv7G9LXSYgx311n5iYcnZikXWXO6XT05nZZIU1E2Ux?= =?utf-8?q?f4OSNL8/oIK+1j7CiBY/dyMIeD2euJQSQWIBB4+ry+VFwfNA5KACR2u1YepQhs3Gb?= =?utf-8?q?Xt093aVARpVgTCaxtS3jQscoKWuR5O8/2a7YpKUDU15qZRw5jJaHV43FFdAjxniGQ?= =?utf-8?q?JqblFRAS2J3CF2ylrO3FG92KHKUt3L3I1mbv6Ye24IgsvT+RzjLJ2ljQQ7mFGJKtw?= =?utf-8?q?vqwebF5gpoh8q5xDZupizJ8xgCMXfSBU/T1SYcGfT8Um7dgQQ+Qm1XGTwyOrMzxq7?= =?utf-8?q?aggm2pKB1KpNYtdfSVEIROfluEQ6xNAOLmAGcRrkvYE4ozxCkmMaM0Mmnx6naWJAl?= =?utf-8?q?6uNrlz6j9saURkopKRH31mPabxitpc7u3WdAEIsN5DiYKWIBDDHityl0bTqxl+hkM?= =?utf-8?q?Lchq5GVHyT+bsVs8GOIJZfY4oUBq+K/mFeDj2FkkZ6TGYlvrVo0bF/0UQGYetQF8A?= =?utf-8?q?W0R5Lh/9SzdyzsS/Pef+ZaGmQ7yDho9bw=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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: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TyQjsycFdKIZAo2u/T6ylm5Vgmi?= =?utf-8?q?NWKzk6VREc5QCyAo0SSBNFGfVkOPFO/3L31DaUa3I1mnOa8eBduTYdIvViF9VVbDx?= =?utf-8?q?7ypbenpaoIdjilpzf7o75no3LkKuiyCQecaolLHineed9NgtiewOSN84YcEPMkKaJ?= =?utf-8?q?Y4UX1saGIQ5UhRyMo8Jy0NSigDL5FsM7pMql0ec01Hhd3zY7FadFv4rLy4Yf3G9AC?= =?utf-8?q?+AK9BlXsp6woao6mPPhGTSMhBvLAQ4pPj8IsKDIWIFuTGo09Q/Uuna5HUM1wQDgh0?= =?utf-8?q?5jZEsxQQIJ7SM+dZ30gF4lfjBqX/SFyOIiGZPugeDR7gdj+fG6kvl7zni/UPSDbUO?= =?utf-8?q?knqgc3BtwNd4uTkuQ/scS7wzNml7MLZH35gqTNL+ybxXx3/MUVzS+35b7uQ0vCdG6?= =?utf-8?q?7m8lTqWc3q7+O/+Yev9inFgHjikDerPpDoZRFdfdP/wSBI4jZha09hmvUH75fAMTF?= =?utf-8?q?TVogX130C40OsJr5vKKDnBnHuld1Vh4bBRX5Pb6CSlbDe0vQLvUzfYwyIJePwLuFJ?= =?utf-8?q?ZrWXLIzycotbIRivk8mS5jSHsMqdm6bsl5pO97AyLK/HIQWG/swIDB+HkX8fMuRsM?= =?utf-8?q?ov/Cy7RLDpLCFuCmr6Wk5UvI3BSSosg1NjE8mmkZHcZpxskrJ6DQ0WJEJX5VcbcyP?= =?utf-8?q?jr/Ag/0jS+Tw?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78ae5531-0393-418c-85f7-08dd26dd1779 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:18.3158 (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: uZpt2V3s6fjoSeNpK+N8ZCTOW9FTqpcYRuuV2IeIZSIS04XS3WUHC1McTJ1X3lhfLJFZTG8YJNo6dPCNO5MxPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171527_081902_EDC8E939 X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 | 25 +++++++++++++++++++++++++ include/linux/pm_wakeirq.h | 6 ++++++ 2 files changed, 31 insertions(+) diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c index 5a5a9e978e85f3fc9d89cb7d43527dc1dd42a9b1..cdc445189f68479c54f85e84be09ae4f488df1b5 100644 --- a/drivers/base/power/wakeirq.c +++ b/drivers/base/power/wakeirq.c @@ -103,6 +103,31 @@ 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); +} + /** * 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 Sat Dec 28 01:14:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BBDFCE7718B for ; Sat, 28 Dec 2024 01:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QQmMYxstYtBHPXqNpTGLlFnw2eRfTGeWpThEeiHMnuU=; b=Br1J9eJrhGCgJsrwVVnmnP/Lyw uVtfvreWyxJm3sIKI9RDNuQ2v2t7acL7Vb1+ipHbe+rlhHfiAWDpqHfiyCst7Oj7PYZsJhZl5T4+k +I1rtO8tziKgvo5wL6JTK2KXaAIkGZyXe7T0LBFvDKLJKm03EAcO9fwYzb9WJLM9NrcGu5AgO75Fe tJuF06RUxqBqPWHhU6Ljvh8nPdHl3i4XTlWDEW0STxqr+fiq8RehnOMcmdbTkqeMuXHky4CRWUSmr 8skH9MEqPVx1/d9ArMypnUjvYIWw44e05o2nEsr4c19ucjcPrHhzLnGuujiOLhK1WXTF51lo0eS8m prOHqxKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLTu-00000001C20-3Sip; Sat, 28 Dec 2024 01:19:06 +0000 Received: from mail-am6eur05on20621.outbound.protection.outlook.com ([2a01:111:f403:2612::621] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLQS-00000001B7s-39C9; Sat, 28 Dec 2024 01:15:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AqDXq0jdL/wwgfH3YPvYabWCXmYalSsxlGH4OzWpUbk1frs0Ek3ybPi4AKE24Fvs2PLOv6lEZyoCbTOcCItF3MHLg6Ii/VGZx79zL7NM+Eqe6VjsETuoX49dQ0hvP9xt1EUmuVdoD6VsWX8iJps40kHhhHaye0XO1Cy6aDff556eSYVNvYt6DJcVBlZJONHOJ32R3SD4qERjQ/A4rjdqz660TZfZVDogEWqom6q+paMhWXtYao7vJHD23U02U2Mcd2kRngFP2OVJS4e2KUzZ8umInEtok17P8bcw8BiFdTk0SqVWbrkt/HcJ+CT8xl0FYV03YYlJLyrrMo9sMv5gaQ== 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=vSs+X/kBp3fWnVmsTLg7S9+o9wn749zyjP57Y4E7XDh+CslRXhQHVhSZLoTFlZu0sW9luqttbB+ROLGriUKwcq3IkFbwaf6IcaPIr4D135zHw2D3rMNGRyCE+A3zkZjJxeZPm55DtQxovdbXT9jPhVN6/fbXzNMixLwLBBmYWGjZLcSF481stRB+en3wQeuiN5wh5FXfETgWAMBxWAEdnqgs/jxoVVJczUIocmYPd2nQw8CrBAVHYedvM+wM0r0ZnpEmQIPfYl2B7L+UkAOi2rTN32/KrNRN1bSs0XHUrP0re5XfIuGFTo+4GsHIRHiOADYrYYJVJb7oJu4Z2oRqnA== 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=KGSpnsMnAzbmgAwnWh1MAH1hEuH+LCsNs7l2E9znPIarEFdJ5i1A3sSRFEclWX4hZUQsFAPuLD0+BqdU4hII/5+FU9+POI7iI4RSLsQ4055z7DnaPXIUyYh7Qk+X8f2ov2BJQalv5N5sNscUd1VNU+nryJFSxKZ+urvypz6V50BpgsybtORaghuFWOVCe9ugAf8gJTWsAR6HL3ufcrG0iILabXXaFJk6sRwW1TBEN0fx3IhVbYGtyK49gYF0i9aDkhLpl0G/wR7wE1eEhJT5ng20B9AB+FAoGBAqcbQA8sHLagUvNQfsYbRc1W580++DUL7pP4FfCfKs/EykeTEwqQ== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15: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.8293.000; Sat, 28 Dec 2024 01:15:23 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:38 +0800 Subject: [PATCH 02/12] input: keyboard: ep93xx_keypad: Use devm_pm_set_wake_irq Message-Id: <20241228-wake_irq-v1-2-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1402; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=lLk6bV9Q4qc+HUdwJdc/NyACnoatpwVUWdW9RwekWXs=; b=5OdW9htTwL8MFAvAyBNZ/2f0h1+VWymLzScDuYIdMdyOM5rQUUci7IzEeTZuelTVx/ZYACjxB CAm5iCzf4BsBX1SdaFUQCpoOFQWyqSIZjUtSq/FsN5iH1g7wLMYaf38 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: af5dd577-acd6-441c-2c9d-08dd26dd1ab4 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?C5SannMBWLGS+S3dOqTvYFYklgzgS6C?= =?utf-8?q?kAS5i7tXkS82bic34wHyiOjtFHnHHywZxIB4bQ3SrqdBp7uer3xzu+tXsXfHR7jRm?= =?utf-8?q?mKqD7lJBsOg/R6uWxpbih6AKAuhEd/Lv4868oJQglxD/dUTZvmufjx4vLo3GMNhK7?= =?utf-8?q?/8PHyyPwlPBxMAU/6YK3ZpZaMScwGFHMps9J6vwDXWHXrL5NNQnNh11sqcdiTh7xn?= =?utf-8?q?r0MHC3q09tjRMEa7TFaQwkM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5PQChIV8JDdCDqRS0kbTnGIstxvvh2+lYm5TI0DhF?= =?utf-8?q?KdRt8Vu3Da19eLyuv8hbaNDceEcQ2CEoSuoQsL1o9Dqb+Zf5JZgmDAqpit5Fid10m?= =?utf-8?q?219FOIAoyn9HytPyk+CP7Gkjsf0fKQHpeZZ9/xV8BSqR1D6YKf+Zi1pyn4hnRMmWl?= =?utf-8?q?tTkE6+Qyg8wFpt5J+NPylcfQSobk2L4iaQZw9gtH8JoKxqFZeTX5cx+ziWqko3wT0?= =?utf-8?q?GsrNsvTZkyB4OSt8J4MzsJQnuO7APw7pllsObs5yIog5BmcjofHyy1lwyOZweBg77?= =?utf-8?q?OR43r477HFx?= 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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nvhZGXsWbB84VBdAB+VwDoHQGc6g?= =?utf-8?q?PpxwEvRbdEMQKQ+ohlAaVzLsJ2Z2sm8CS7ys7AfVeIBlLD0Hk8AfL10QRFv5+qtdG?= =?utf-8?q?skQy/hd8CQEXYRc5XGRQ6BdFhe1/cB09OIQFy1sR5ft7gXPQo/EXRg8XsnBbh7dyr?= =?utf-8?q?gKPNKJdnPcT31xbzmfD/UB5b9cg3d4WFcRnJhYG/WJsEl0dz9IQvTyUGFz47Vvy3i?= =?utf-8?q?NSpy6ZgyzdGCY27hD7+K0/mqrMTeIWsTyY9S3pchgeutiPBu8x/hdO57Dtqqu/GcN?= =?utf-8?q?Kka/tDPI5EZNm2qnbpclAjwAsllliLj1XaK0OFe7Bqsx2i2iBrdyiEngSFCXJmONU?= =?utf-8?q?ldBSSm7EdMK5IhXtY2Ar+blUF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MRyjgtZV+2SW/RTtgevh?= =?utf-8?q?+d5Y9CPfOmpP0//31l0bRniqFJcuPJEqKVJyIWY3ZE760hoxNuoFxiXWpl3a5hnPv?= =?utf-8?q?AwgW1CQxQAuUibG9wTuK0K9EgAXUXPKprzkAeLBfv/uiVF/ERMOGz7y5/uoVn/+Qg?= =?utf-8?q?mwiZv72JgcTZpYW73/xZtIAVnnQX9Q84qDHuO0Im6J53yFy7E0NJk4C+aez6eKt4M?= =?utf-8?q?2Ww25QaMNVzq3qQSG1bd26NQKa4MwzJ24W/gC2yDZ8aOzTBiOUrn7PVMTdZ2qR8vo?= =?utf-8?q?BsC/wCWNDMWK?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: af5dd577-acd6-441c-2c9d-08dd26dd1ab4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:23.5158 (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: LM0zqJEORufJ8hy1wQpfzRbClrJ4fHBq4b49P5JnEm5v1slV/x3WUf8D/eWqw7T3KCpy11bpsluupP/mcawKxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171532_809917_D0699576 X-CRM114-Status: GOOD ( 10.63 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B820CE7718B for ; Sat, 28 Dec 2024 01:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5IKPGXeC1zMipklCs2d4pwue2MPeCyDpZzW+Ed4GFRM=; b=vJGYFLt9KKvrNumexQX9NeS7FH xzBYfGeZrw+NxEhl5CQ1PzJ6d4HcfyPD50aqj71ZSahf/QibYPEg8S2jXtngniQe/Cvowd0P+Xx2n hBD3Vv6mmDWnzfesjoNQPhYClcqaaa3Tp76ywBuvBBJws50ctS0AztsUWPlhE2ps3EvmxlNR2ojxw I7Nh25lXg25WIja4T8DRNcZI9Dm9lPpt/OGxoPsQrkt47/jWGfppaSch8JflRkylLg1OO6uIgLM6W +VAoVVhHBg79bXiqJujvPt8/XHDCNpcUFE3XPZd/HgIbo/gMuRouV2spPfnpuYoZuRqqp++VcpOfJ jyCLlv0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLV6-00000001CHU-14mr; Sat, 28 Dec 2024 01:20:20 +0000 Received: from mail-am6eur05on20621.outbound.protection.outlook.com ([2a01:111:f403:2612::621] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLQU-00000001B7s-0sB2; Sat, 28 Dec 2024 01:15:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lWEDXFj1zRBZbCj4jTywAYgUog+kXOLJm/GyPFk4BSTFhuJ6sPkUZCGU3ydCnqnB6iTW7n1Z4/9NXpZfwQ3tHnVoaFj4aFhUkRmzyuOySq2eJV9vZCKrxTL36b8qJamFachTUDVUMhD4oNCGnYbpN5WRLwXNH+fTM+JZdpxP9IMpb7IhvS+W2GTn9fOEKZFAvB8GUZ1Y327P7wmHIzviAiQPir2qUPwokDZm40TRvp1Cbi5L1rqjUXJwOfEIeG+/kLKkeMl3laLpRPPxtVQRuZhE3SIVJuDWOsN62KJKHB2K4R/7QyczSoUXVl/UMkLVsUksW2tQP9nF6zvRO/TqqA== 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=nMK61q1f3iv8IS8mVpJPXCLtlAMGuij5lngqJRXQktiudXn2LWPhNY6LhhpAfKb9LQmeo5gFoglFha9iQm9p8VnQ8t71mbHsNsh2EjLcQleHnAO2JIjR84eFB4rF6ei04jAHb57tPbjZHciTrBxetf5ioLSfC26O+d6cFt0qiiMuJVYi1HeCLjvtMjwiirnzrzbwXjV5eL0H/sp3N6nlGy/K1vlYuXdF4GgfBiqbaiWUSegs7MysJa1EuErwTMer3dJk24sVOC6TeYWactjcKZLhGpuo2P9CgIEkGhg5dzhD942c9u9rXAnD86EsVuldNQQ/WmvLGgx8WJqI9QJc7Q== 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=XBLE3//aEAKVbhEC+/BM1AxatOEnWwzsJqOyaIsZkYVospAzKoJsgqlZLWgRXL7KUD5PK/hIpFEOS6PEpveF2Rnyp2ax7gLzjHRNSIxSbY6LPsSJr8Ptm/uSSoIW+PQJ8rrcL2vp9CFLrt9yx0Sq6x+Q0vm/632nvRTeOwpWQOWGts6HjqExsCX7M/DbaCktVYgX+A03ied7ASJlyXGZvAHT3JmeqpT+c4A1mEoUEXmQUEAkDttlKj0VFXmTrlzy80R11Lf66lb44eMhz+QIm9hB3DUket3x0SUxHle97tYthqdDToK+kHU51yWEOkbdshFZ4wMOYmD6cXEXq7IIQQ== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15:28 +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.8293.000; Sat, 28 Dec 2024 01:15:28 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:39 +0800 Subject: [PATCH 03/12] input: keyboard: omap4_keypad: Use devm_pm_set_wake_irq Message-Id: <20241228-wake_irq-v1-3-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1365; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=IYFb5BcVnaCb3uUN830r92UAprUHpPfeHJSpQKDJq+A=; b=ITPynXFen6NGI8Tv+l+31DPkuKOjZW+qKhVpYyrqEi1xXbuJiSLrF2YI2N0Bz1lh8BwJ5w4al wmUn6KOWVzGAMLjoeV1RPp2jYZsny3AhGb+XF2EJuPOEk3vDtyGfzq9 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a463dc9-5b0f-4a17-510f-08dd26dd1dcd 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?5x1/iyif99YqyUC3jNzcQqvss3Pvijb?= =?utf-8?q?kdfKolf8vMAYEvSHjZEVOn82J4gs2978zUikI/2goAV7cN2tgpdtUZ4Eihcx4bceQ?= =?utf-8?q?stQ8iIW9WdwzANjqWniTGtygPo1qy1wPnq9XxqibOh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g+ulqOpFCnbD+57Iq28pnItD/os?= =?utf-8?q?Wa9GTip5B+K3b0owLzUKI82628RalCdO8O/ndYkE7SHUX7+osshvBDvtU65leMuk0?= =?utf-8?q?vr5mgvAngnjo5wJuarxFArt2ARsS9sRluGedzISeh9leeIzm6LMsyqtz1begTNVdF?= =?utf-8?q?CpkFGK5v7LOezy2iZ8m169JgyOVYaVQBJcHtxqmBpooKxcEMI6R8NF3YnHu1aAPBB?= =?utf-8?q?4vXAoDxn8AYK2rgPOn7D7hVDi9Jrp0B4320zQNYKiEThKRVZwP5aN/SAE7vB78XUF?= =?utf-8?q?YPBAdExR2Jqn50syWYrAc3nNRH1LwF9fqgtaQktU7Vwersul7pXkZYi3ThKHZpWaA?= =?utf-8?q?FHPslaa7F6GwanlfSxY8iFE7Us43mE1y+im/vEU1y2lmM8dXsFsgnSd3o8cXjpMWy?= =?utf-8?q?mVwdZaCaoxz?= 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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Ee2tHoga4G5jfnUXCRlJJsIZbw6+?= =?utf-8?q?g/jGP0I90dCNM9pkD+TjBYb/vpqaUlAcz6QTGOoeIXfb/Aa/oIL7sG3rTHCkmn9OR?= =?utf-8?q?hhyowuBh9rfKbHjThoGsYEWmekV5FpmZ5DYxvcrh7yyjeo7SwYpGw/nU3Q5bHETOW?= =?utf-8?q?EiiYZq3atVy48LRiFvbT7SlKz1A3VkEipyQZtza1soGI+ku7LFBmyB+lOkZanP7eX?= =?utf-8?q?XUhBehHlcKxR7fh4t9kgNU35X2qF+5POjwxWCX0zrg1Ef4DenKziOArcRrpWf080C?= =?ut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utf-8?q?OC79pijG25sblKBv93Pu9AE74PvAsqoDnXdQRtqDXoTf+h0qhNzXRil6pTRZqdzzb?= =?utf-8?q?xUHsPuCPlUFmmL/dk7KOiY/lPSZSYE9Oih75JUMU6pjj06D1jd6J6fWhhI8V8Dttj?= =?utf-8?q?+Sihl8NKF6h0Gtbp9y/Vcc2uftpc7pwhmuZNfPN5C8ITgJQnvZJGwt5tj1NZ2FghF?= =?utf-8?q?5uP4O/qVr9OWjMq45Gfs7lCxGtCrOIbFlOVRvJ1Fj6NU8FpfuCHJZXZRPTRRYOdDC?= =?utf-8?q?APwKPaKqH+fV9TwYCKNN6RPQckLwYDimiKpKesMyVUkfqPhQ8Oz4wOR2W0xwf93wT?= =?utf-8?q?Ayy1GOj1bV1YnFsdVhTYGHJK7x7RypG09Nne6iuQnvcOT5luFPhVoLwomqfQPpvVd?= =?utf-8?q?/kLZQ6XstfZ3?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a463dc9-5b0f-4a17-510f-08dd26dd1dcd X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:28.7241 (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: LYtznAeGYIu8MZpOGd3NkS0oHP9D5N8RErVMSD/mWqkv2HpiJzDvALxM8prkBUt+znJIsOotmJXLljeiwbrM3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171534_259788_220FFA03 X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12A1FE7718B for ; Sat, 28 Dec 2024 01:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=CPYpGJONvPzTWPRPrywWiNt1uPIgnnmzOhZHbWxkU5I=; b=bPn9Hr84goswzY/FzMrSEdjTIt L9MVWsGS9SjjtYH5lBgrXSlPDaAAMjcLK/2/PR6S6bQnnDUdOoOZ0ub7LrCmnGZmCmFNZvb8ItAAL GI9eMQODsXdGEcb2kmYZ1zXCsLhHRbcSK453Yf+1eaFk77SmS9B1uKRTP932IgcjLwJ0iEYYFnQ1I F77X+46m0nu1up+fgQDlqBpXWii0kAR505TN2zmQMT6jF/5WuFcd/U0IBO9jkUPS4gxwt7y4jP72p 985CjUdeUOk8z5huXceVSopeyL0rneGLr5J1lrpegvTG4HIkwUUB0zvY4fE1J17O64ZwaOoADLlUq E8rKp48Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLWG-00000001CSJ-2rAo; Sat, 28 Dec 2024 01:21:32 +0000 Received: from mail-am6eur05on2060c.outbound.protection.outlook.com ([2a01:111:f403:2612::60c] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLQa-00000001B9u-2mJF; Sat, 28 Dec 2024 01:15:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=De03qc/7+W09q88nvZWjpdJ+r44syFhmY0TGXrDE9q8cLOOQ+MC2FTi/26TBOTg1z71q/Njjd2+YilGj2hVqA2yBruyaElB3FzznpfGnaJFCyehc9x0U5kkafytI4nMKaOdBBe3iuf2o0DBS0O0e3DDuSIKrL6PC1POWXdwPlz8yvMOasg1ES5hAuxZY1ER4iKQAzwGhflNJnP3qo7ZlZhxJAqBfT69E8uDmBUQ7OkMCx5BA9Z6i+akGtRpBr+BEb75qnSg967vVYBGvDiak7OnV4huxskJ12YkZCfTiAsLDTFP/cQ+mOU/JxPEn7N1laO3U59HZAE3rCv1cMPKHkw== 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=FW5NwhB6l0ulZlgR8HG4Y0y6fxynFZ5VS3ZIxGwpH74L90gXYmN/Z0R9zJjABrQOvPeDSCsaFgG1jgM0xzSySFtFHhYpyWlbjktQtwERCr/aEMcWiWoau2YF7puLTfamwHlk8K6PQBxTy1bwYfJFbAlw6Si1pKdPNhoBnkPk7LGmEADNJj//fMsMdrJEw8PdAje9VqE/UsM4UDVDtunaYEHfrXyo3Y0DDRLfrMiUVHosTRWTJerLjfkfF5BX8nxpJZVbI5jC49AJdAYwtLRoEpFiFhtC5OneUhmhHyZG6/K2IZ8q9pjZ/hgpdcZarohsaWgvza8fS5IvFEvBrPtcoA== 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=bdVTbLzxiZp2lRvyYH6Bc24luyGUH+RGc4fBdXYmTBIVFgOTXEViTJ4s/2MYXyVZF9izqgQge22bRocgyzocpeFBKin+IBVVMZ8zsQMn9CwojzYW8I5ieqpNQfHmOhcVeZnglGDVVllkty5SzZK23UEsnCZO0Ck0TX5BkNowSsfyT71QeIeZsVALm3I3fkUT2GEQOfb4dVCtObhysKjGVxBY+xu9NnrgHTyo+CczxQRzDddYsePxupFSjSK9gvqzEVngWyndAeDV7L1nk8wtoEpQnSEX3YtJJjXv4viJbdwfupfOJMULC6mPH45PnVWPKFCFkJwrj3sli68tjXp8fQ== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15:34 +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.8293.000; Sat, 28 Dec 2024 01:15:33 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:40 +0800 Subject: [PATCH 04/12] input: misc: nxp-bbnsm-pwrkey: Use resource managed API to simplify code Message-Id: <20241228-wake_irq-v1-4-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1523; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=g2vZhAdAlG59tJHA7zmPtBw4oLxwHW1tSbJmlo9rLyg=; b=n1Rdvh+byloMgU9fVOo/u/dO2fgSbylAiFhuEeGCWpv+c5cbO6HQBC8GN4OZ2AYv6PpvAFCpi 5ptQtE7Ox15CwPoCaVywbzaXII03UcP1k2p2mA5iZLfYxQWU34rIpK0 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: a8ff64c7-de9a-4bfb-c06e-08dd26dd20e6 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?AAKgOTso9fXPeztRCyMP/AagQ52A/vi?= =?utf-8?q?XYjHh9MQ/PITWpRmlEm7dt07jKVeDV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A1pynbHDt3xLMOORoqqCkBf7dTg+eHplgpT1?= =?utf-8?q?R9A1/gIjLJ4DubfJxH+QKiWzsPzgfJMaeJ1f6gtSl9GzyBqoy778PLQTvJUbwMSlL?= =?utf-8?q?LC1wgHbLdKjQy6EBfwpGFV84qSwGJp0OVRspfh8WlKc0ZyYtWuV8HpxoWIVqbyccw?= =?utf-8?q?77VFG9jwYc3c8iH216s/fnxv3fSXbkUnw8gC97oxWUUmN938gP3WmMfojMqO3Z2Gp?= =?utf-8?q?HB/3G6AC/h0G+YMHjr1A7Z+2W7iZL8Ouu+gXMdmIkUNLtL0BjU6fjmNzRDO+54KiQ?= =?utf-8?q?NsZilpjLI47vsunnybcbjMgsf2dZrWKCECukRKvdsY7Z05XbG2A0aR1e636oEp+EE?= =?utf-8?q?vEDbIm04Fv0HhosUKkGMSjX4DHC8x0tv5gGGF8r33xuOQ1S6rayC2a/iwvrcVM0r/?= =?utf-8?q?GQFStQiuyDTdileraglVfbLVpB3yzb6f9WGUHCHTMYTAQov3paE4C0lgy6xTFvfFA?= =?utf-8?q?RIg/e8Ng5Vf?= 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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IBbwi7nisCnfNgHXAbwXfrO8fXD9?= =?utf-8?q?EKoADMVVeRf9m6TJFqMfByQI2P3kAWa2m7Dwbvxvy52N/NWwoM4Bi0USjb7XfO44H?= =?utf-8?q?gyQwVycJmBRHRVYiOOzw/StkhouzKoDJwdEGTpw4wRRILOz6AnH65n/agXtce5Eeh?= =?utf-8?q?j5NjIm71X5D514wjzp/UnoW/Zxg72Na2bb0XpySXO7/Pzq0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utf-8?q?GdtMsPeU4VaqCzEfX8DC91L+vTpUakW8eQFhzQnxTvWfLWCazMslfho4tOMMbUrZc?= =?utf-8?q?fDMxb4f4Vigp8g2n2OqV18pKMBStH7rubE8+52tw0nJAc6pSTSz6QnNMXnaCo8bdm?= =?utf-8?q?zh2P8iTRIryPrhZANskl3nrlEdHnT45BhRyjCKIClvxKlP8+tEgfqukKjb5TrQXg1?= =?utf-8?q?K7Vgw/bxZjoaeky9topQ2at/PXu6hqa+RiTj8y+tYP/JehBgSmKYw9iVbwZCro7vm?= =?utf-8?q?VIRZUus5m+8gMh26q486VoGs+/AqN+EjTjJU94liJ/EYehrfwk4QBHt2QdVVrzrkB?= =?utf-8?q?NV6D/xiScTDpai7UtlyeKuPZIJB7QraPTZ686m9RUW6Osp4OU2Jda0vngWWMj9GJL?= =?utf-8?q?L1VMUGJNBx9XHytxiwZreeM/mxotX8YZjvNTEYLJbHA6jds2naozj5m0zUdQ93hsT?= =?utf-8?q?eq1NLF9BgLhT?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8ff64c7-de9a-4bfb-c06e-08dd26dd20e6 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:33.9459 (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: hD2oFTTUJKXRjZyLT2oh+iao0KNwr0nZ8a2u/HrrvcMaWm+QIY09MWs2jLoUPjFMjxc6FzhvpT3XbtSHfrakHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171541_012624_BF930365 X-CRM114-Status: GOOD ( 10.57 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0972EE7718B for ; Sat, 28 Dec 2024 01:22:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5OsavgM1wz8lRB0WsFrbteMiy3u9S097VGTdXo7+SFo=; b=1nL6jXgbjk6LRu3kaHhev2wsNj OsNC6S42BWdW9loJLrRU4Aco2g4qF9g+6o+gLWvzYUQ6XRC0n2ztxO2iN2VZHMv5GvEkX67G3C+5E CeK6UhthS9oJt3v7ea4OUmQKHi9vdWJWFmtdVUj6mQhbSLsP9EFj766Z138kiN9gPS0a5OVdqkgMt rCoTgnJ1e2PWQcZ6LFBI2cZiVYuIyQ4VChgGYdVNqb8qKongaQZqz4sHGXDWuJFhsqNXcImDlE6WX jgMK23dHGDO0up42v890FdSLDXDmb+A5BcYpRz8EyJDU5KkUc+JA6toOESqZmh2YStxFgGZahffPz pYpKjytw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLXR-00000001Cdn-0dy1; Sat, 28 Dec 2024 01:22:45 +0000 Received: from mail-am6eur05on20619.outbound.protection.outlook.com ([2a01:111:f403:2612::619] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLQf-00000001BAr-3Zdx; Sat, 28 Dec 2024 01:15:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w/G8BdliSEHx0Q3RhzvHHb4gZDm7nd8U9oyXzHd55Bb4fFKPUAXiMIEYSbuoOtbEdxG0JouEjRZwG3JSzXWYa2OV8J7Gk7+ZQEc5QSYGTDhlk/iMuumAOLuZKALhA0NY7/vvhvFG9E6J3RvOK4CuJX3ub30pcS5j/pJ+/Y64//MDlyaIPcQBdnYWvKbUKXgnYTanlVTNlau9EHKhC7TeeMe22obWcNCu3BzioLHeUiM/sp/w63EIU2byRUTDWY+fJKY/LlUU+wApDaFlHP+nNCJEog4poH3eW2luSbXdaP6qc6Vugkx1/OxtRQRh7JKKZ0RH0vyoKxBye26eqhkfZA== 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=hk8K3Ny6SJcd0oB5CBOmWwUHHYSFPOGMqZiLcSj4I6HIJ+mcVCcEqb2DNKWFrSxsg7MMPlW61S33HVlo8RrKXGhCO9GwYVzE0A8XaLTvuQ+m8ZqiGaIGQ/yauGtSQnN/DAMwxLNLBBbINirOoVBiTvHRX76wXszoypYB9oXLr8Qoe+IkInF7d++7eIU+FWvjTGqnCZ/PlMwd9/Ictqn30TqOvEahUoVBpz+fE2FRcN6Xiyfb/LbtdEagShvRYexD4Fz290E6bv++FkNSGfaA5yzw6nBOxYf8o2junUS+Zuv1dzaDMA3UGJvOzUekw6rxYmqWFeYH+AM4tNyv9GqWjg== 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=cA98UbwEXYy8AaaZCydgYBXUee5xD9rfXQc112Cwt1t46qevMbnGdlyXYxRiyqTMQbRks6yg33cY6oRN6OZESXv4Z+UGTxs66IztXA5iJyQcha86e84XoulwQtFDFqX9GKkq/7PtytAXgXZrhq64S9OFDvN/pYkiXy/+UFZxRnn4iYFMtV30o/1nqulxuWT+7Qeh1jm11T5WQEkaAAEbCtpmWu5IoJ2LQ5YtVblKRfhUc2WZVeYf+1uHerV0p6xCz1jqP1kcSNKhMaQfuHAdumfibwaUDVvTFp91/OEDHehZVmG52FqQ2QrVjS3KMz11Yio0UUsa/IYPVgyu5Isx5w== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15:39 +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.8293.000; Sat, 28 Dec 2024 01:15:39 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:41 +0800 Subject: [PATCH 05/12] input: touchscreen: ti_am335x_tsc: Use resource managed API to simplify code Message-Id: <20241228-wake_irq-v1-5-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=3411; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=1lZmp/EoQtZDgK9cRNpEHi0IbcGjqZ+/tYP3nl5MGB4=; b=UXvCXFxS0bdNfnP4i9+l23yI6Hpv7q0/4Axzg63Hm6BI7CWYSX2VuRHQZESo9FnGhA2gXLlZK 2S8tSKbe6vRDK3wAMDYcuopjwFCx/eXV4VwLcGndSqEbmeNg5AVJ4EE X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 441ceda9-a42a-4473-1f83-08dd26dd2404 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?AhWqgqw6V9Eav8190tHYAhqJVIqTL4j?= =?utf-8?q?hDTM57787ezjXyGczVqghQmlDpL8mjbS9/m7IkaOKHrex5I3p1n+eYWeH+WWegBQ8?= =?utf-8?q?9auDOwSFNNk8e9sOmwDV8zskTfz5cCxTXkXS74FNDz3AFjer+KiQESN99ltl1VE38?= =?utf-8?q?o3JYAbPLVFyGNHhjqBZMjKxP0yndZMABofmH83XFs3Kbk4Gf05qlpIWehQYDntEYx?= =?utf-8?q?1c0l9M9XVQIlHyzuMEdqDzt7wucp3Hrk4ok7PGVcTZQnXs4r33zk9ovGnWKYaG7Ok?= =?utf-8?q?hhY3ZTW6gLkEGm4OmVgIO/byxvIQgolSkEayyuvG9gVLrYGzV2eOIG6i+hD7vg8RT?= =?utf-8?q?vFELznpLgYBAJ6ob1Nw0QDmY3KVD0BB7gZ6AvZR6mgtbiPuR18JrNBMT/UCiaPYWI?= =?utf-8?q?N2ZPcpMq41MItcQF5HciwB3baX9FpJc57gB2x5BcC2zblvkWhXsqnIXb3q2SA+lP/?= =?utf-8?q?r0BpeDRLEYIlatkSud4iJ32dLB4PU2z2PFqcV/4VRo9PsWGnxLc6tumDWleER3GSg?= =?utf-8?q?Wa8WXhjYc5Cw4qGFqi37RdY0feAIU3keUasNYl8Bd6hiN3C5WqUKJQM9OcJ4wxphW?= =?utf-8?q?BhvzQjfyPrQ5blkwh18ZflGQ8OtlbqaCsXlqm3Ov+2/PSoV7iR2IOKL0l/C1ODdMY?= =?utf-8?q?RNg7Cv27zfGdu1lyumKNDMW++Pu4WWkOXr6bEkeWeHpagw/TaR4AD3JILOe29EW7Y?= =?utf-8?q?TR6shKotG/QaaI3DFAR2Scmq4WfUsN7fLzNq1YzS0KJGkz/KuDqicSFJnOWWeE3Q0?= =?utf-8?q?VbiwMfs3CH9uBQCHHjs1GMcP5B/eFgupa83G2qg6GdFNpdZcEdLvb3bdyLnux17M6?= =?utf-8?q?E4avWmq30pHMprrlQA8+ui3I3CUvNHTVqlI/TMTWjG9zO7qa17ro7871PPcv01Xw9?= =?utf-8?q?WRX/izrW4eSA+MjJHhZysW39if6o7sBfxHgXnv9wLJt2xfY1SSm1z4gmVshnaFB2A?= =?utf-8?q?VKa/1EnnjC7hl4E3ByVLa+pd++H8nTXqbrAzwlhqNUD7/RLnDn4z1FSoYbWOiNB1y?= =?utf-8?q?w/I7Yyx06dNSS0cA+fY0jGCUJpYdsi0K79jYcu8Npv/DdT6Do8IYBcUrh8SIXG13Y?= =?utf-8?q?nC5ByYFsqXITJ7Hr+P9lCBUMBptdvHWnyMVRdCWQ7IzHbL1BkXiQim3pY8x5hx0+8?= =?utf-8?q?ogBQasIbWzQTNndaMsECxJnQcBdSdvm9dDQXQeaq46tDXI3RNZ6H3Ec4FBWP9Se5w?= =?utf-8?q?ao50TejQbhdRuiMsfifPvUD/Moo9hjyN6I0keZRXsUTX5JcodJjvu7vODQavlN2Qi?= =?utf-8?q?ezmRKCAd13seZ6cTRKGI13b/STbf1NeghwszsrHhspNi3ipc8zcW/ZYQwn6RfL2IX?= =?utf-8?q?MX2dBat/PVdYLQ/am3d68R5mu9in6G7WVGhMadcmvOYbdgqR8xNKBCa8L0SfCSx9f?= =?utf-8?q?dkSfhqlO4opvwYcUn3sXtd7qY8j5js8vQ=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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HRsZKkjQGP615dC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-8?q?KRF/SNB9vBmBSADlIBFx8UCYrY/0nQBJLfn+kU62XZHRxZrLok3m35F4+REROZyt2?= =?utf-8?q?LfUCrTYIQciL5W27AAq3cIgmr2xIWN1W3aO4+JVGcv/JkGulMMVbfbmBTND9O6a6S?= =?utf-8?q?GTMqvWF+Sfz9vd+XHLclF515Wl5ThRRwyHY1P3aW+zYCvSmdV1Ka4bfP2h2f2pivQ?= =?utf-8?q?RN7ge/sIOJYP55uaXL2YId3grycaeQieq9/knHlt2fGjBfla3HXxNlCv28nseuI/B?= =?utf-8?q?7WYqKYetWM6FINUVCweLxE0cXLRxGoXUmtCj1Eut3z8io0sL67i4hrhY7ZouxeLV6?= =?utf-8?q?FlXJdH/uMuesKcBoWSbbv0NkMhzYuXqT36/j7d0w9RJweuQU17tYo20e82WiCkaAw?= =?utf-8?q?6ZN9dYgdnb6owtaSpmQIjiJ44OLTAg11R22sz48wzKcygUrkSc9nxf+tGgyWMFHMb?= =?utf-8?q?6S3OZs8BSTVELFyH7p1Xz+KS8hycR+yWyk6p1YJb7xZK8EFzrbgUgf77bNh8JZwdB?= =?utf-8?q?Z0+OZm8qPccyP9Dqy4jTiP/KXIyiLJNWnogPkLTXALZny+t8qDOHcUfp/8+3ZeAHO?= =?utf-8?q?Trfy0rdL4Dzc+N8RQb30q0pJKC/6LzLt5YgPgDE4sFaSt3FzMmv3IMMs8AVNBPtcm?= =?utf-8?q?wXquFGUJw9HN?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 441ceda9-a42a-4473-1f83-08dd26dd2404 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:39.1267 (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: PyPBH4LLq7gK/75BIZcgsVFHklg6gECQ4xtlci2JbjNFipDttoEZuJ9Z+RuUABf1SdXC2y/91QcgaaSnArz1Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171545_906940_3A8EE666 X-CRM114-Status: GOOD ( 12.01 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D33CCE7718B for ; Sat, 28 Dec 2024 01:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dMs9LoaToIJ+gozHx+CKfcyWbPCk3fjmjLVoS+x3j5E=; b=mLngfqJNHRsq0SZbLXtJnw1Xa0 sTjDI2DhNl4ZYbXe/X8XvLcPLkpU3S2Ah3Q5nINPpnK4jqRIHDRaPSiDXM+hTedp3RPTfOS6EW207 UF2p8XeIHwqBUO7b6wBQE3u+UeVn+sKykNmEePZS4pi4Aul9dYfyyZ4saWV+XbtsBGOjeLL3CrAHB jjWo1rKaRVrnUqmoZ4INBb7JaIm+qcgGJFVux7egrKcrniEXqLF80e8Rc/ziXHnRrk6kqI5ggldSv DfBj4uItpXHDdCzwkp/a/pm3UvL0K116wbiURA2ZzBjCFA67kyc07Lyk+85LTay4ENhktJPSWVDwh UysQLCYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLYb-00000001Cpq-2gnk; Sat, 28 Dec 2024 01:23:57 +0000 Received: from mail-vi1eur02on20618.outbound.protection.outlook.com ([2a01:111:f403:2607::618] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLQl-00000001BCO-0yPN; Sat, 28 Dec 2024 01:15:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=olPMx0tE6Ed7jYvTX0V9egv8YIGEugwqDV0iITMiFZezT1oYT7/8Zz9jvFnsKfpsIRpZkyuO5miIklunKno1OLDxzzjzZOh4izeWWdt+VX3j2+MVWjjoGjAoKoHMmatYQKZ2R9ZldqBUEUHpm4Dd//NfqPzxEDcGscrocV12fQ6xNrLUETFM+NorUMIDPRNFPuTSempe/5O83GLSZVr29MZchLGstIjW2TzW4eFF6LrRdrnbZzQw+3lsI5gvS4+NYOfd2Wbqp9mXjV/gvNS9dUX1NyfEThs0BHhTIskq2O4v04Q4HlihmMBSqRng5ERqIKX9vVz8lcRq7Hfoo0sciQ== 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=NdZO4KK6Cnnw4xzoOm5Q6YfK8kZvbawsHzox7CCkum8NdHeT5jCpWpl/7NKdb+jsIivo9XdnDfeUaPW17O4TvNzHkUzVBVGkyKwpr64uMtTlQtmioB14+oS+3TuboxVhzDAAu1kiL/b5z1Xhj0+MnTvQPQjRJ3EUKgTxDfrdYnR8TMl6X6s1CEsMVmGvM2WLX8uq3Gl1W+pGG7bH7FC0Gm0byZhkhLa/NbP8itsVQCuMWsls5vvVdN1nURqvdUpbhCtE8XY6iB9/XHn/MzrDW1yTSrgycb8MkblB7tz6CJ6GsjqI6jjh6XNvYTG/d8mfN4MaR15W2ZUJxYM3qPoZEg== 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=fEXGWJJn5P4XNa0sBDtpmP4Mai2h0uOC9b66ZC+Q1ZeRfeaoDlkDtiSVfIVM8mypCgYZxFYnjrDE3JHAfzevvUtMwxGWia5baxtDcRiQJBGPv1YEb2FQaBDEFrY3uoolISyGPba2FYhDFwGmYRyDq/IsnOptfN/MSsC0hD3MKteJm7whbZJwpWo/1SC2lduAFN6Nzwn0kIdZkqXU9KYRmLpCVnNlfoneMIcwST8iRRcb3jNfNZBaDrgCC1gNikHMcmGPqGUKN+NkArdXPK2UT8rGBZIPPlponZXr7V0Qz8OKvQxvGlh9NuqhylK7Tgvn11bpbcWnIWUp68rd5BK1Eg== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15:44 +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.8293.000; Sat, 28 Dec 2024 01:15:44 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:42 +0800 Subject: [PATCH 06/12] rtc: stm32: Use resource managed API to simplify code Message-Id: <20241228-wake_irq-v1-6-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1529; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=3L5kSry1bFWI+vzXqFXX2mukiWSnq2LH9PLt8NvYjoY=; b=B3T68jTJq1CEoyhrigYxE+0meJO14wNaqx5QKL+LOdMajmlDmTiJD1lez46bwXprMXVKEvpGi mJWb21WGEHODrDQuLK0flOSEZPL8Qlp3R2EjTV1CpPGtdR9Qqxe+1vD X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: c3ef80ce-50f7-4fb6-f7e3-08dd26dd271a 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?P9XXyQn08p5anJARNCBGIVRI2oIWLj5?= =?utf-8?q?cqbJ+stz1BvjF0fbx6TIR0k/gBQ0VG1W/yvQzwt2O2OvT0SqpwxQihMg+U2kXM/MR?= =?utf-8?q?vGmR6FFCg4dCBuUk5+/a9Pk6txTb7QUHOnI/rOQj3OtrlTCnQkpIkkNG/i1x/i2/U?= =?utf-8?q?kqhXVzXg2pAoUuPX8vwf803WClEuE7NHioTKpTUxwjFqR0BbFxdMqm0M5N6U43hEv?= =?utf-8?q?4za0qB4Q0L0Isdv3NEwKhEUk0EnAkoQ1s9EBLcJG2ItO8FcaXj/LTfZTTqgxl1UlK?= =?utf-8?q?1U346cZoKdMkBrEjSRR4CZundMcOXRyc8sKn3UO7In4Qja2zQ7pgxblfcY1RcPolI?= =?utf-8?q?cdRwWs/1ZFFIlbAqRbDw2sEsZJMk2ZYH3OlQlU6MI8CxNMruXNvnxZ2BZ6/YhSusj?= =?utf-8?q?YtgEjUPABAa0v/VZf1yGUwgMPLl9r8TdwYzbFJE9q/e99glhZF1/AVyXnZN92Jsya?= =?utf-8?q?d1YXnQ/8341HhrFuq//ktFKCmaZ1S6ADMUjg+RPED2fMa6b14lAjGt7rpv7xcQMO2?= =?utf-8?q?/M7nBhEa8cKL4v0DPgfL3aPX4p4nvbELvxyzjCNKrKZNETKr9oiKJWmetF5UjZwsO?= =?utf-8?q?/Z9qiSSLyWamda+tQ4gnd07PY5g/gAGKkPVw/PDDF1qiO451aTNVW9K5k8tMnXhdQ?= =?utf-8?q?/t5QT34h+1R9zjmmooGF22f+vBMXg/pujXIh25iFIZDsFI4SxW/1HGVXybBshoNh6?= =?utf-8?q?oeM9oyM9E2GUbbl9XK/CR49A22OKeOU9uvxRVXRNjQ1tmQ0lcyW38eQBNZ8f3mW+v?= =?utf-8?q?v7q/8hvzXvkwqLfpXj4DzxYJ8xelxcyykfMCVfxK1+5KV9sCnbG3fT0WqmPX6HJH/?= =?utf-8?q?HTATGpqwwlWiqao5pjScXFjXf2HyhA08Tt1hMixROK3P1F+AO8tY7O4SjzTr/NIxg?= =?utf-8?q?XlMajhtmrqaQIgUARDNIV7QXZqcHqGqOzHcVl84zEgZYWJoHWox3MVqSUsAZTBg8a?= =?utf-8?q?jvE00aREr7PDmPwsVS8t8aj2za/iIT8bFe0vBB4/3dqd8BnUzpN7ev7EcsLnqD5Y7?= =?utf-8?q?27fOaGgCFtAPnTOqbtOm72awgaa+MaADLmiEaqDKH9/sUePxdyYj7z5mMx8d/29vV?= =?utf-8?q?425XjfsbS11cQB7RMJQ11DmPaidlfifYlFyiiB6k43Pnel2TsmsD+oKs6uCnMOtio?= =?utf-8?q?xn4fFv0tOOkA9slGyVCYh/r2AIx15aFt1DPjxPxJbRzEQnjEC6737qPm3j+8+1Pe+?= =?utf-8?q?7jZyH/io1FPLxnHFBUUhhmSuV/GTF6m0g/cd38UZXrEQ1KJxZeaGN5zLYYGxjt4DM?= =?utf-8?q?TjG3dDmqVIdlicTofF9urx2EzeI5mUfXmBFVI/KTbAiWptjcTWySD8DuoFAtUtyKN?= =?utf-8?q?xq3CPg2X/HSzR76Zm1bvLPibFtD7nVDetkC/IHcONL4dVkyA/utVYuMn+abuKvUnZ?= =?utf-8?q?SsBeCEsSrdl1+oOfqSEReT2t+3QIzDy8Q=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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSp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utf-8?q?ekq8WH4zpso8B+lr5kX19bY/fSB8zec+R6FwzNCHlrlJkWhbVFZ3W+97CSpjj9Qqa?= =?utf-8?q?b9CkRNXWvzWRMZvbtwoZipJfIb1DNFxU1YnjjLezgc5OIANVBPJFcGBA9lS6uSqpy?= =?utf-8?q?21yskW+96Bfirn1y+M0hGkTJ1epKHHrlaUOFUq8dIXKHRV00vXKB9LpB582nHC9vS?= =?utf-8?q?SxQBSa2Y6kz4J2XrfPSagHdDVJpzK93hR6mwKEPuS+z6kbmvN6rpRWtWpDzgH39M+?= =?utf-8?q?F8faWmYNRVJSIbRzS7hocTQrw/fNJ2w7aqztl/FiOfWWcKuWglJD5b/Wx66tQxrkp?= =?utf-8?q?QjH6deNVb203ls1Hhnre7TfOM7yyZv5JGJqLtRNUKyktZRrg2NGc6jtTv8dqMwDW/?= =?utf-8?q?KwcMtyMrP+r5+2l5y8BFRsQe+GicC+Y2OcyoSuwUL1OSUP+sWAsNvLhmSq5pmtaRA?= =?utf-8?q?PyKTvH5Tr4KDPVqpsT2WmhDYv/Rcz3QxeacnGrbcoMuoktspUY5vUfTuYnYWQ/tEW?= =?utf-8?q?sF3L4weeFH+aRafDhbf0gwwKN2Ok61Zy7BktKO/BL7/8rimftErM4OwCPgHNziJz/?= =?utf-8?q?VmFhiMWclgGMxl/Gm3m6TOhB8gbObafcB3ayxQPddJCPG8cpaNvG955FUjQFqp77R?= =?utf-8?q?Xnen/PhQYTV5b/0URp7yKjLdQ++3qKg4mAPmAhEhiN8Di4O6yEifLJVbdDObGHOnt?= =?utf-8?q?0pqQzRAsfaXz?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3ef80ce-50f7-4fb6-f7e3-08dd26dd271a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:44.3329 (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: EASzHYX0Y9Nate1j5d6Lk4cnEVHCD/u8gP/xBHIzZk1pkFSOr8l8qigS2Jf+nvLIykTkPagclVuGWw56ni4Vcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171551_282567_FA1550A5 X-CRM114-Status: GOOD ( 10.15 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CE66E7718B for ; Sat, 28 Dec 2024 01:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=r2hVzGwq/lGLJf/+SRytq7PzChhrqrxvhNJyvMgE8xk=; b=XpFNSBbNI4VQDdTlLuLuipDqrF BrEAq1InYbEE1YK0Z0d9Rvrd91B6u11nudx8OAJLt6QMOWW1hcw58JKAndBw1/u28RsPjo0YVq9mX /osjyZ2oAdLkoPt5/erxNoT7cpRIbPlcikZijevsZUJDNqK8acvfgu6EJiPzfb61X8JdolEjz1In9 Rdd5ZOtOr4jxHVqmC8Ko2jg36pMd2hvGyut88rlZMOMl6URM/nm3lbUVIEARbY/JpUwiUsAkayeop NYTQZZkT5WT4dEe9Lz3A7CV/uGOt1lJHriLNvVaMZ2O9xgBtHfk4qipzyudo6cAzGwR0wEW42JwHt xV2W2irw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLZm-00000001D18-02j3; Sat, 28 Dec 2024 01:25:10 +0000 Received: from mail-vi1eur05on2060b.outbound.protection.outlook.com ([2a01:111:f403:2613::60b] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLQr-00000001BET-0GhX; Sat, 28 Dec 2024 01:15:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tf/lEd8zbFuK3ibEDx9jGqHKWkgJpK6DF/FCgfeqrd7sG7zUmyFwL3fc6gnpkDM21YlngW8JWnpOvB7zJIlW/HcZBzWRDWjrro7Z6fCyUBbhB4pTS+9JlLPVVhQD5qeHaAv2zDN4lWzPXWino2KN7Gae1X0TOmkk+julNpYBRxYPyy07QljT+n4dKNqEbMAlleGve6i+jjAtIA4mKsQZW+OeQWqw+zw7HdKF2uwiN3NBukOd1VSm+9hGWkrBogitdExYj9ninwBPggHAAzEs/fFH1ACpiozxzaAaKYdjTsWj8GeS4AEuMVKd2nVd8/rlaWXkAuJ9h53jSS8GMERk6w== 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=xeuBrPTlkMx+d+wO/drwBoY5rrdQS42JRT8bU6e4tmfMA/zfsYoX26wys/YQDOW/QMSIItfWaEi+otBczYTvp20XDe7A9Ax2hSdZNx53OShl408PgeZcbraw8IrReWVrA2Dtb8N+ZNpiYoaMiJCHltGMdUB0oA3PM3ipae/lttvgLOKlOUYOY8FezrfcxI4QDsISqyNa6X1Ce8bkwc0njeV+irhG3/sBHN8IxlswWxtxBafG0ed4F8PumFW0f9McwiKTWuib7HoSb8uDXWd19C6qzE+KCKRpyzlRRunWkt+qZH5H58OhQ3jQAhx0T+sd3CoQJDiRTSINal0Q4+tt/Q== 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=JboT+Epwb3x2Arjezq5MdwcMSqep2L0tWB1HYJy46fthtfvPQj16Pb31L6cNT4gmoJcp00zTTytgYNpf8UID/tnEBymbNtULU0A480vijRl3LWQbxl2LMkSHrIXCjOwz49gjKaLUsKo3SMPEqhxxbtZoQpCQy86w2qdmABnPaZsuSwCTsqv/2tf76WKQ5JfRZI7vBNomdr7wBLKpo8SkmqTe+chkGXGCXM4ep6Bqg7MgoeY2gZ5oWKrMRGHsxuhivncBxt7W0lMVR6t5KztVEDpXWfjUFKYA3+x9dYPKEDDgvPVagdsroJeCeYJDgP7HDyL4N30GaDsBOvCbUpQ6rw== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15:49 +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.8293.000; Sat, 28 Dec 2024 01:15:49 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:43 +0800 Subject: [PATCH 07/12] rtc: nxp-bbnsm: Use resource managed API to simplify code Message-Id: <20241228-wake_irq-v1-7-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=2071; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=VAulaoWVPhHtzgpO1nG1u9VR+bogAGzfLBxhdt2/l0I=; b=/Y2rJW+uvGVymldGjTdqHDl+b4ky/5JEFPBIiquUwbEeAm86Ox9gFX8XXPk1WjXf7BQX3ZFl7 EVH+AXBrsT4CjLNe6ykOi1b3V/H+/sq6s7NoLo4euO+l/d0xsKfEZBx X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a057b42-4d3e-46e2-a3e1-08dd26dd2a36 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8kLL5PPXT4dfFka54uebgWFnIZSKyWj?= =?utf-8?q?P4+BR4ZriLrnznTappqcwZRvfZb23aDnMoL+SB9rM2PIEGCTe97CSSEXGi3o80aFr?= =?utf-8?q?NStM/DH0q5A5lYhAsOYjEaNvxHqZHK/IH8pExZkrhh7dLAvVUnRabp+Vs3kcdX7+d?= =?utf-8?q?hV8lBx2y1iZNSuTglElMIQ6y8BU5fgSD95m1e2SoWN6JAkZFiRJlPJHhZmv9HueHP?= =?utf-8?q?1/jKaO+uZlm4SRWzRARqA8Z5CycA2LtzV7bjt6XDewlEyzfa46LpK4pmhSvxilHho?= =?utf-8?q?mHC5CpjtSYUijpI/C5hp3E4ituEA4a8hRhMFrz1Elb2nmHOB7+MrcpP2aoj5iZ1V1?= =?utf-8?q?fkGXB9GhvKbbfxQcO5gSoNS2KxT/84WtMLqtYh9vaJzP/T/1mM8Lqb7sxZ0EJTjER?= =?utf-8?q?QDqc4zUMYQevfzcEy99g9lZbhUYw1uf5XVGd5pFJ0z8jZ463AFeMiiugdvZJjFO/5?= =?utf-8?q?nh9pq6s+V0XUdyJWg0Ul9ZurqKQQpcMZh16cpUmKG33Smz8p24DGKFdIUVNuDjzig?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?= =?utf-8?q?IMdfnrQi6f0?= 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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?yp3N0TJTTpv7BFrIvwOF+PHMLEx3?= =?utf-8?q?4TRDqMIgFsQH7mrLpEClQ0zNQtH9CNjqNF93BUMtDaVhCjMAQc2rol9MjhL00CdgW?= =?utf-8?q?yxIyGpH7S239abXIo2P7X8usnhSJAG8yWVzrrZBZhfZTOUgji5d1i2jDoTGIyuj0w?= =?utf-8?q?5mvSiuhQ6uX/TB3Sj9XfewBOWol68ApW0P8wxZ3mHhqJw547U9jznI7Ri2Zqblose?= =?utf-8?q?0zdIB4neO3VMhdGEGTjLqAiBT9JPHk775Z/DpJAgKNE3XIpUGZkeplRf8UUC93xV8?= =?utf-8?q?QYcFxw4oNnZf4oknTke6O8neQy8ufLxSOagqhy4A7j2gP/skitr6r7gCatq4BnuJa?= =?utf-8?q?esFIXfKoRJUZPBDSGPIk4wL+r/H1AJfUfg5TkrAQBFWBgtzLa+g2Jghy4IaSGTWus?= =?utf-8?q?QmDhmgFGrI5IXhsr+tFkpHu2bK3YIQZ9CPAYlCP3ti8DJKBIN+RKihGRhHEghnKWI?= =?utf-8?q?iOv11elEgLP/Tz20nCleE8dgg7FktsiT2SOQVO0weVjsNooMbNu0yi2ZqMk63kCR+?= =?utf-8?q?Lgnu76axJpnY1TYJ8k0nnQEwfmmPXMvb+zma5Nqfq4NuUwys7qimjyBCZ8pmf6uJn?= =?utf-8?q?1Gdqc9PqUirQ7JTfNqTVjEmry/XamacQPYKCyo9mdP6yu3Qd3ih2L8iqgvrcfkKqe?= =?utf-8?q?tdrm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f-8?q?ZQPdwUPiAF9M?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a057b42-4d3e-46e2-a3e1-08dd26dd2a36 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:49.5526 (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: 037cqaYX6lrRruUNEz7qXHqPSkrDbyK6Dt0fVNXUp1BYwzW6EiUo/aSAYpeURU39MuecTrPOjL+EXWPjkqZtVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171557_113773_C08618D1 X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B98D7E77193 for ; Sat, 28 Dec 2024 02:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=vHqCPDXGCYVRf2nk1Sv3EKhZpGf4S6daEGQAX/zEh/g=; b=Lxi0Ax6n4JmDDu70Mc5klCYp5E Q1K1huv+CJ8gH5/GqhLEPiHiKSfo9v6Z/5zpyPTwbLFizknz3tLseUBNWEZE7tcOMbsuQt6KvVt/e ozoJgEBOMrACfGd7U7t7AqAFjmtcw1ft7ipvAvQDZk5fgnJl0eFt2ND7+PdJ3Pc6sRGgLXs8uia5G tWuEEN/F8QW0E2Bpd9rHov1wOO8m3qwMi1QRgQs9cVR77Mv1EJNDT65EUayZKDxZbqRcSztQdu8iC Zf0p2IgFUwPU1Wox7CoJKoIiPnojwG2g4pX2d617u8797EKTN0ySPBEhTd/mkV4Sk/acQV+sDFPsB zPOyJNSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRMh2-00000001H9J-1roQ; Sat, 28 Dec 2024 02:36:44 +0000 Received: from mail-vi1eur05on20628.outbound.protection.outlook.com ([2a01:111:f403:2613::628] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLR0-00000001BFi-0SPl; Sat, 28 Dec 2024 01:16:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lHXDjsC32wslnnL7m9PNn1c/gxKJLVmRX0zTPfuCv96TTCJ1jI7rvG+EjP9gt9a1OFDHXkv1YZ0Qz0ilSP1OtSEEY2+APOmrJpqCoyxn1fBOvYEHXZpxAGPhCL6RT/MBUYfJzgQSFRnTahMghOk1oN6O7IT5zC3Vcea+eO+gpF1K7pA/fE78XiCJPtgaWJqzcBMi2A7ibmu/6D3F33FQOPPwShx2hVD8Uyjr1cMGuDvbAKECUHPqMozaJKycfdudvk+KJaxW7mudIbzlZ5DnM3/HBGhX2sj+eF7Ti4LHXlDjxkaQn5a3BGrzC0B5pwIoAHBCCNrdyUlXa15wuaUGyg== 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=Arzkft/TW8P2dsrs3yCzTwNhOzT4Z8ZX7mBWZAGNdZERYI+Kh/6+09nop4ZEhiQpH8RnKrGXHI5wKM5R3pvJ6mQZ0qNgwGJYGc88FXWIaEoFHIZmC+owF4YR5LBNA2QyEkdYlsE739OptvRXXoTfdBu3ns4PCyqDsaA3Q84icEOIyv9DjV6p5g4Q4ytQFesAsOxX4Am2ftVE2DwGpx96RUVQcElEJzlLuJbcDw4uOdTeGpNFsmKj2AaKf5HsWCKK3J7xEbJhfjtFapCNqC08D5sD7IzKF5CLKlhL3ziGD2+F30dSgrNlEnM1HZgHzCABga9ehHccttOJoj1zWDKdPQ== 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=k7BxjQzIHzaKczjRlj4gihW8gshonT1kqxqWI170XRTk9p4LDLpDV4vEK6tdiKa5IhvuDbnQmeAAlXJ4hWt1Z5iESGxwAPNiyNo1rfgoYxAzN0gr2pnhdl0iwnvIDHDeA60m4Gx9xhqss1Wz3UfEQUpgHA4lw3lLOJWCRbd3BfSeWqcgcjd0XUdaMAi4RRbAYcq3vjGM0hiECYkJ6nFix2XJIEBzuft461yluK8o+VBdvnRStzYBogStqemonUaqex1MUMRCfVeZDhcwOv5YIw+XUPB9+/LVLzJXpbz9b7oo7Pzw5a2zW/vQM6m4Wzvsvz4+zW7VtA4jSV/NG84NTg== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:15:55 +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.8293.000; Sat, 28 Dec 2024 01:15:55 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:44 +0800 Subject: [PATCH 08/12] rtc: ds1343: Use devm_pm_set_wake_irq Message-Id: <20241228-wake_irq-v1-8-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1119; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=yYeVC601Fmqm3h8IRsE1e0gqqkwuyZ6uKwkA4brZ+6s=; b=M+cjMtBJIiSnSiefeaCL1kRXO2h+J0tucG3uxMJe5UH0vh+z5jUGXRMNrSqfIEAjK4/rPhH/h VZWDY4zP6vtDH5h+voA6RkrS/HIpVqO3Z1HUPMPZPVSPN3MNZ7k/Psb X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: a0ec955d-cc44-49f1-cf2c-08dd26dd2d77 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?A2+RUNAdX428898qq1KgJ/nGwHplDsF?= =?utf-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27gUMC73JROSAQOZ4bs2C+EST/VvWfR3W29Y/xDzOqUOWac7rdDj7aKQmoJxZjv?= =?utf-8?q?t+YN5XsDuF9t9y80X0RjZSPiYFoYNwrutXb7pgy3CcObL19u3qoka/SiwlHBO+cOi?= =?utf-8?q?PeS9N/T5xH80WN2/S/nVoEpfXErU8NjPhzuTEE7kAL5sJ3h5IOGJJVoVFvNRJyUpS?= =?utf-8?q?vE9UkLOf8oW8G4l1Q5qaRNDC8wXDQpSXJq8sfHki2pwgSRjF5I8c2Jqnjck+tlX6q?= =?utf-8?q?4R5P0kKEtxMAhjmnpi1CuREVJ1UL/0WMVtPClxsK/2JW2MvWjx74LarQTUa10jfhC?= =?utf-8?q?V84jgLtGmBcp+R6sDYOam3EcGSXvbFRkBhnHGnp/VRNZlKizah/zUs67thYOq0/JA?= =?utf-8?q?4nDT3uoQefhBWUdsPRpXBBALGyFeNVltKVOhqOF4T+9NuDHb7WNUAcPBeVz7Yrf0K?= =?utf-8?q?edmskvHtlEHN8EVlLjh5sc0sqwCQkNrjy/ACHOhmp+FlGFrkWTuCSuWx/I14ia/aC?= =?utf-8?q?jzEteEHOqNaUIa2eJqPbOyHFsFe/4YUUg=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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?EBNYYmuG7BJZ6Sr57KtTytbeOBhn?= =?utf-8?q?eOE7SFWGtAkEPrkElpXo2R49Xz+/EMSlCAjVFushe/qFkzZ4HaBjfwcM6Y2tr9Zlk?= =?utf-8?q?Fw5DrJ5gTkICScyygydlejRer4Tzn+dlJcrE6zlrR7+dwx3kA0a7mwzz2/RM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-8?q?noBU5BUxRiBI5RERAMP9om7QAC4kT3bEPNZMxKSszqVwrC7t8GsUjLlC5xUAZE9rO?= =?utf-8?q?5L9Ll7hMRAd1WxhNoEQGqkEB7tCm0o7bJdGGDi8i9dSAsTNTiigsBIBSdZH6Ip5/0?= =?utf-8?q?YX60WA3ebi+IYjKAIfsb6fOVKlsuiz0y8+hzltaFMo/wkjsGCnLYALk8eJ2wGOOc6?= =?utf-8?q?7MGkEwpv0xdI/8PuObPqM9vM5yd08CiDAST43zhSSeK/Ilpb9O/IfysIOYtrGhGL3?= =?utf-8?q?Lx5cYpPHXBBuPErPXaduzAMSdDgmyQ4YlHrvnanXzaY/8TE/+6HPPAFyqhSv/8KsQ?= =?utf-8?q?l3lCC5RPv69o7jtyi+9RwcsYPTnRZfEOc3nUOk4cbytPM8JISAZyWDlrKErnkIvKD?= =?utf-8?q?/8uRZH2nqxfBvNCIAARJeEayxlNdFdN78K7RuVqfvQIHpdwUdiGxySmNyloaLCFYK?= =?utf-8?q?M8N4qv479QOsNIVuuoy0C53lEZl9kTUqKXQCRTreK9GRWmnTntv3kUiFdGBJlb6gc?= =?utf-8?q?E/RosWJdxGKm?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0ec955d-cc44-49f1-cf2c-08dd26dd2d77 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:15:54.9933 (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: hwvKbv5GosjWqZa2YcMCtdodJ0R1g3KlLznc3H50OvVOScRvG5ZLdmEa57bndJs7fh1Hwkm/eVx50B3Oq2Iq/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171606_170557_1C77D722 X-CRM114-Status: UNSURE ( 8.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B214BE7718B for ; Sat, 28 Dec 2024 02:36:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=pGOX2jb3HqPmTJ5otbJvvs0HLQQh9ahLhmtSC2Q247w=; b=XCWRknt+kLwdK7MSMtct+bM8eD U313TDH7BHrV/AWfiZXqgVjuoCxm5SJYmvTLy4jQ7HWfUanSvs4J+mJGPtYDLWfD2jLHfYteoKJOR 18783uhupULcRnphbHz/uXMOqXVkZVz8F+7OzFSTSdk+5vRQ52yKaDl+E+KOGoVM3HdVYT4nF3Dfn ep14oKOgj0TmXpWr4TEpSyLkTSA2HRQQh/obTGEgqU4pipAqvVoelBjIW8Sq83jxVb3Yru1Gu6b5W 5tsKqTKe6U1aIoRpO5Yr9lX53w28p4Xuz2Ei/IzH3/bJOiLv5lCOBWHPEsyg8x/VX4k/aM0XK8JB7 +9gQ4V4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRMh3-00000001H9b-2oJe; Sat, 28 Dec 2024 02:36:45 +0000 Received: from mail-vi1eur05on20628.outbound.protection.outlook.com ([2a01:111:f403:2613::628] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLR1-00000001BFi-2IJB; Sat, 28 Dec 2024 01:16:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TW73kT5SM2qg5sm99Xy7PevMYBjQmCodm7XlAhgWBDpCUxxz1/k5Rpo37/EgD4o5CAADs90yk5vsyGQ747pzPFBGGFYWSomG61TuPRI1Ula4WdZ9Zeerx3ltqT7kPlRS8EfQ2TqTgZYDpYI53g8nmrL6aUfxYohIlMnpHbupJGOskTFaK40Ui9WnulI10E154X/Zrz6VSL8wpE6QqoMK+dDq0YgBstmgH4sXDJq8FNMI64jT6gT5qW30WaNiYwM/Ql2qzsZyQQtVYADpWyX2cjkaB+1UBeEIrBIvSljaCNeyn7pZYqiIkDK3accHSOcWH1gRtNel48ldtowgkxCVfA== 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=qcOAbfADEE3yCiHYIZ7hnRXsplmajjCKkWDVMtSkoj+NAXsDe+lLJQl/iQ3f0VvaWHLJjAVpLdxiv512Q9dtd1o2Io3vWO+o59c4HEWMyUqcWg9NrTFUHaPJbVclW65+Svrhi7T1+/5lYPgfKrNHgEX9iwX1KhtlIM7tXunenFkOGJZ8XyZ/Ce6ACOEmtD7iqx3KFpQkC+etaXi9O3B5WIOP7yW5dZx0Vr9IMUFm0ElARv8aJAHOwVAydcl3eVzuvLzD7dr7PlTc4jAUt8PykdYqVs8Ca2FQz8VIdomnY761ymzc3Bj2GU3OLFvypmotGUyyZMlim2T5KaBWiP0B9g== 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=C/tf/3lcOThIwmHuUfWQZrYwl3CVThLUQMhCZ9IOzbKddcmYgsdUGK3BuFrXXj00A1E+OOsCOWrjcM9F8RHf+RUiY8/bz0zyAmo/G85apfMwQu/CdCnqW1xd4eVIM+/voXR+Pas7JESQZOuNygFUoFRui5xCDixH1rlUHg91hBiTGqqMkSHz7LIkqxRAbKUj2ZNPjxslLPKwc3CzuzZPtkCZlO/tuLlq88aiIBc4ceQBo7Vp0CGgKzyj4aY46b+usIQf4LPLi1xsQltgpxQk9WVvuXK64On5Lfp2VVJ7Ypm7sy4+ltqcsdvFpVVZnju23wJ2kQKshYn5zBCWgMzeJA== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:16:00 +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.8293.000; Sat, 28 Dec 2024 01:16:00 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:45 +0800 Subject: [PATCH 09/12] rtc: pm8xxx: Use devm_pm_set_wake_irq Message-Id: <20241228-wake_irq-v1-9-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1049; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=GvTygPs23OU+WJ4Ssa5ar7+WSYAkUwf2a/2JL3pAL9Y=; b=fuTuUxBpzA72Kp21pez+zNIQrc7GeIb80GQ6AoCih6Kuf6w5GU3tFr4HYAL2bco0pS2GFVYAx lQXFpAX3Yb9BFXbDZCsQZuX/uNEfUOyCxP+nzE5dENo4Aq3m1j79BLI X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c455295-9197-4e68-5b11-08dd26dd3092 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|1800799024|52116014|376014|7416014|366016|921020|38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?utf-8?q?pzy5jTfu50ukkSdeURyRHFm0pTQPBzagYgp5YYcl4TQxdaUgsArlQE9cG6YTcun8M?= =?utf-8?q?QlzxfrWKpg4CG1urYCGE52KewhsgVymITLYNWKS/RyKLeCKSStT3QRjVEKmWL0Lak?= =?utf-8?q?Y3zZ5M0GdAuVpG3b+KV/4Uj4jCgEmpeeC9FghAJb/rznCyo9MHyeP4HzbdReJwa4c?= =?utf-8?q?NZBpRX44QWQn6GIWcfSlH0FAjQRs6zlVWxwn6fgdXPIzmboxMNwxPBbYBp7xECFok?= =?utf-8?q?3qPNKXDfsIMIEmpgwFyx+xwvM/oO2e+Ov20d04CGsGUEux9bvYs/nqJoiUJJN5b13?= =?utf-8?q?D93kCDmg89ak/dr/ju7Yug/E8Tk4bKoLRBaNdz/pSl5zICILzOlWYNWGiLIR5dSAW?= =?utf-8?q?rR13GKKaEPZG6pyVMma3VIfiRXvRWACm2qVIgqRF5k/C2u+853Bl2vZXIjzNAuMzQ?= =?utf-8?q?2T2BV+OzeIiLVthIDwQwuG0pQenOWCnDYyanWNCtfpAzIgCTG50thv+R/Igi622G7?= =?utf-8?q?62apNWSKc3F/a0KaIduPqW0uSssKRSOTKSqqoabnPB5rM5IV3WKo56OLYrpRh33GY?= =?utf-8?q?U2u3comQ/asAej6WQpj7wJHEupVNUcEhA=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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?PzvqoOzfBnz8FKFPBPN+AR8I9pm/?= =?utf-8?q?QXxFlmg7z7EYW0bYM0M1EJDe28X0dpajxYQaAGCrL4Xv6eOQ+Tlk/s/UAq9Yz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?= =?utf-8?q?nMae2kWKVNyye9mwEckGlakDDhIPxW72rJiU3BNcJ/kgizDTdxKtV8lnc27DtnUgb?= =?utf-8?q?Ubb8heym2wiUNOvMpoU35LIJEjGnX1ci5Aa7y34XNV2oAEcO5jOG3cgU9fvPj6s9t?= =?utf-8?q?Tm7Y9ISAgPIDxJvZ1RRmqKPuVaKei/bE+gDc91+7H44s5N+9KdvTdotdP6flKjHkI?= =?utf-8?q?zQ3gUqysZL9i2ls4pMDd4LKpBsvZ4WMCNzKgM/2duvtRJK8LqHgCQBzSQ4lKIr8MY?= =?utf-8?q?EbLERQ6k/EGiL5hiLEzcPutI1azvO2EI72c+pWVKVg9lvekfLYcQ+wgqeu0dUQRMR?= =?utf-8?q?k4Vae6yMh+U3vydjAs0O/rvSoT3L2o3SSTzH4BakmEcPZFz13xxXjunYHr37RFN1Z?= =?utf-8?q?mt46qTt6mv0HgIlJwCIRQ+tH1gOJ3xMPpPQF99JGGy6Aii9Qqtm8QNyD0ByMtIYHL?= =?utf-8?q?b5Fjy79Jo1Pu1mrKhj1dRgVCrMv70U7uySyfmpU+pgSfhopQg1X9Ywan5N9wkY976?= =?utf-8?q?zY0B+WuIa3is1Wu1yoFZDF1BgwgLoJa5SPEXtaX4f8jgQVnO7oSAcg/h5FEdxTGgd?= =?utf-8?q?KFrYzVyp1rDv?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c455295-9197-4e68-5b11-08dd26dd3092 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:16:00.1862 (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: eyY8PCxEPmljJos9fmkXDE7ay/AXbvO3S/dSe9oHFq23WNU4jI7bbcKJv2IUy3Ml6BGmWmYN3Rh+bC9u3a/InQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171607_596244_8EDF091A X-CRM114-Status: GOOD ( 10.87 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5D9FE7718F for ; Sat, 28 Dec 2024 02:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9NhpRWW3ASTqePzIcfl7k16jaBoNZfLDhAqRr8CDYGs=; b=pvSAEetjJbsCYXrSVCMjmZxwwt XeBSgtLMY6D3B0fg7waD5tSzN7KNvTgs4O4RXgahWgpIoL1jghjHXQJLoHYNgb/2QH0QrNYHHQduM RiPB2VTli+vOpUZEpjKs+MGwtFfH0kaLTL1fYWE0045NGkuIYp17Bjx+tTXaX1e/gwFNxRDVBw1Je 9phBif8N8DkLJXIHYCls6k+AvmY0kcNiBMYNjU3JhCrjcDWTHxKet8uh/w8fHbalsHIg7w2GyOVDF U7WSGnTyWQCL39Zv65UBk5QxXEbSjlDPyqwG2V9Toe2EL7GriVtczWHdjsCh6hygqB7BLu/BU9t02 uVM5ldIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRMh4-00000001HA3-3v8U; Sat, 28 Dec 2024 02:36:46 +0000 Received: from mail-am6eur05on20629.outbound.protection.outlook.com ([2a01:111:f403:2612::629] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLR6-00000001BI2-1F6k; Sat, 28 Dec 2024 01:16:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CZ6gdXIPLfjHHP2y67U3hO6zvTNAt/t+5ja0q1RDQtY8T7ZVo5AnpHuMyajXYxA9TSffBjaZMdjzP5G68/3cLvIg+HPibX/IuLpWVCGSldWjizgTuglhQrBElvb2Sa1gYdwSjlY2OS1gd4qQhKRUwI88vUEKWcArbDl/KCOuNw/PdAweHf0tSkkdVt0dmXQgZOQatWZ3xtRqdpvOnsXBnxLDKd61aP+OFyc/BkcEMam0FVTrrcEpdq2IUZgvFU00JcJW/7AqGj1+rIuhguhIHtK/7UlXz5repTzsVaKYJIouyozGQQGP14kGO6V5qAj10yUx0gpk54FpDCZUUj1q8A== 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=AlobrdkVfX/38MVJCt8Iq+/b3rUpD0WjleMSu5zbIM4=; b=cbKKdlqxlu4F+RwOV3FNhP2MVOYZOvPxDjpQ28hAG9hPT8htRhfHHWoeJ7sODHCo7dKEtvG+UgHqzIU3mvc5VYWOTcvLr6vBA1yPzV/UkkhYWezIInGWlc4RHJfn3Ep6gDIpDnIjvjJ0s/hhBFKGIRB5pdNIRZE0e37ECLcJQwwNJL1kbQbsTTue2GlU2VSfi/JpYhInFSmMzdil7fbrZHwiDOmAeCAMbvp/oivX44uPSFIzvHBqvKNoVeAaEzKrk1j+pg++vhpJblZFrPF2Q1uC224PgpFUkI5b4MqHsLk6So2Gi86N848+9Dq7JkhKwi77/yI5n/VC9Wt5A+RUGw== 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=AlobrdkVfX/38MVJCt8Iq+/b3rUpD0WjleMSu5zbIM4=; b=uG0Ep0v+6QTXMa1RdhceJXxdlnGtB9jFpcBl32bUXTUafyTVd2k9XQ7O6ti8rtqw8p/i6hV3UXWrDDRZ/OilXbmmk9JyX7lxYFYECbI+o+m4uxZJvrx55Omeygok35IO9gYuZ12UrT4cX5lm0htNsiz7d5r5TvU7VgCw2BpRoJPP6TzjQVFy4ZnzB8kWVSk8ISvYneurx23imGwUWrE2I6lNefwVmtLlHYz1QnZMbVsVZOruvlXQqVlpwTd+sBxFt017IL8sr3GXgvfL6edpPZogqUeK6hd619vnCvkRJo/u1HwFF7caP7jFwxVxX2t64jesT1d4p/uf542U/s6T0A== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:16:05 +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.8293.000; Sat, 28 Dec 2024 01:16:05 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:46 +0800 Subject: [PATCH 10/12] rtc: ab8500: Use resource managed API to simplify code Message-Id: <20241228-wake_irq-v1-10-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1542; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=AVqWXSH+9LxOuTXtwUAoRCUt6CUhlH/6QudqZPFpQdY=; b=RhDPsrgbN6Cz12kt87YwDpCKRz6gWnKaN3fVCGjJ3KW5nlRvnx/OLvu3OgFY4hlgaM1G+FH9v hEr8JDrMVBOCCgZCVbKmi6wbwHJhfmvFo2Vahlk48PpOT/3Z0XdrW46 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ba8a545-524a-4099-9954-08dd26dd33a5 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?taruziCTWAaepOGnSAs4seBJxQQ1D+D?= =?utf-8?q?ZVza7cNeonVsc06B3/vA4tPqmItTKrOn01pJdELK5+CYLsA92hPga2bFzFYTTz5ZQ?= =?utf-8?q?GoOAS5vtlbexxPL6qtLTIk3zycMrfmpTjDvTrvoLAhJS+AAUMkvhmmWw+flWqnYU1?= =?utf-8?q?sg2XZzKpbkE8g8Jmw9hA4bEHUzqOPUuOPrfI/vtBwxtc0BkHR2o8KKdBsMrvZf5Bn?= =?utf-8?q?AbMh6fDxuADAklYp7ZNnu4Jm3a1rqC+I48+QpHT99oFJjek68wcD8gGjF948YUFFh?= =?utf-8?q?HpFQcGKNd7TNHnInBQUSUv5SDXKi58ZKaLGCzLkeLorCwClAZQO08F2enJMUeToLf?= =?utf-8?q?8w4emYx1E+1ExRwFPjfzaTCyQlbXsHmpHk8IXSEdPWEwj0LXo1RYucjtQaVvnhRiP?= =?utf-8?q?vDPbrg1fwp/Kn0smmBDO4vb3EFOom8mIA6gj7X5xXpVb74uI14NA8Q0yWCvXhfVbF?= =?utf-8?q?TMqhqNOCu/tKHeoGZGTEODt5UTegPrTeGEW6EwJwJ3kPvdapqwtLAbQOvX6aLv4Ee?= =?utf-8?q?F+YRpACQtfNVmjZ+6xr+6XXe6f07uWbljJ+/xrAsrANMHAm9FU/wlxuH3XH730+yu?= =?utf-8?q?2CkFHEEPaHqFREGB2bjqH96mXsrlg/e9VgM7o2eAEfP16pma3k47sTdKy1pq2pScJ?= =?utf-8?q?zNAia+AFuoqvYcvC6b3N7Ug9Ls5iB9BrxRwaSuETyVYLW955ZN7IE2KzR8rFT5Llp?= =?utf-8?q?M1nGPB8nr4dfx8TDK2ORua2/+lGHV3+5fZDflfMKrI8yPteVjau+r7dz6r+vIA+2c?= =?utf-8?q?gFwRA4NFLk8I6oUo50mY9T8aztAki+zs2VZfmP61UdSyZuTXj+TTGEvDdwNmwa+n+?= =?utf-8?q?+a9aOxuSJ1LJJKfOi3w6g7kuQtYToIE9pX7bk2mr0c89INMN/l8ixUenagLBsc2QZ?= =?utf-8?q?nYZE7GkkuqpDJo5TH+KBtUi8qxcovLsDNXfmwPSA+iP9pUZXjPtPfLLYYL8ae+S8e?= =?utf-8?q?kx1rVPdRsZEyMrdkPrl266BdlBPUOFbirfIq2LwWiPWBDEOsUQBtPK4hb9Y2Jblhd?= =?utf-8?q?6T1rmqlP2XvedngVN2V1HdGC9KQ+sESk/WDmdaWp35/yyUZ6/9anEtDk3pegf7KwN?= =?utf-8?q?Y8z2NSLR8gCOHVqTMvq0plnhVQuJyKhYLRYxluWU+DVJLrurLILbGnBIKIpRJgam5?= =?utf-8?q?o5BEhopDExr7wPXB0JKf4gEpqMISsP8YQcYhjJgccDqfUgsZ3R+zmjeNCd/E0AV1M?= =?utf-8?q?2fSo2lHdGavJaIufRGalUBYmEUihbldQiEhFb2PqBNZbsOV6/KNVRHKP+nfEVE9rP?= =?utf-8?q?nM4LCXamGUTC5iereWllU8XQFZb5S1DPaqjT6uAWWqby+cvtPz6nwzJZ0R+UD0rzO?= =?utf-8?q?L2a3t0FbwMf/zB5g3WwYK5SKg7qVymcUOFXkrGnZ1CznedSggopFKBPDY6cnsiCXf?= =?utf-8?q?HiiGByC8cSoPM2LXyeH9PHCmBIeZoZ5Ow=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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?fhSdSW8yKBbT7zvIXcJcJfuwcQ1q?= =?utf-8?q?U8e1Lqckf65HE9vCBnHaS1uD/00cuYP2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oz0Ozg+eI8ukpWryDG5zeYhs9xczS?= =?utf-8?q?AqGNDUF3LWiEFf3X8/kRoL8x+c9Yvv+9Rt/+CuVJAAZ9FgKdtn8I/QG/YbUXmnu4h?= =?utf-8?q?V+AMkMoFJznY3lATpYIYqWZffclObVSth534pDeDQxD2N7C5goeiCiNhoRS/p8IEA?= =?utf-8?q?+aj1XqdZdb/sz7ZQGYo77ubMvna1tF+i/+DsTAd1HaJGoLovWyX2xNe4oXLgIsA2T?= =?utf-8?q?wz1JlkQRU7SX55TGyveeJxeUSjG1cg7GBeD/wQqp2h1wnxmtn+1UE5gIKbKyl81BB?= =?utf-8?q?waLuuBHG4SF2uhzyUstrCIJnCAQoVZFF2Tm/FCO8ATjJexLuHsdhSur0eZh3AwxDo?= =?utf-8?q?yEiQGVZok/LTP9UbL5s1XcPb0+pKH2iDcwQdyr/Y05+nDlEg3ndF5d9qHF3WRCI8I?= =?utf-8?q?tuV2Asd95iy4i05UjwJyEKV9ra15vL0MntbTddqS26xM2Yjhd5OqJhcBM+gw3kWvd?= =?utf-8?q?TidXHDlpRO/wG0b251RyHPQBvFlORiWDPFHeQXRBCUmeCrr3wi7nWb1iOkoaRMnhQ?= =?utf-8?q?ucDtq2xi4eJWPtdyFhLuk4nzHToLMK2sAfbbIg6Ycv3bd1oJC2Im0/Zi/r77AnEub?= =?utf-8?q?dYb6zF4c6fKw?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ba8a545-524a-4099-9954-08dd26dd33a5 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:16:05.3762 (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: AKaSLTWiob+/xhXPj8ShaJViObRyPTr6S09bGVRj0rjn9e3njfuuP7OgrpdyUqGfKDiz1EKdAgxuKrtMPmmnug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171612_364237_9E557BAD X-CRM114-Status: GOOD ( 10.99 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Linus Walleij --- 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 Sat Dec 28 01:14:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C422E77191 for ; Sat, 28 Dec 2024 02:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4PKvgjWWPKh7dNiOPG/9I2mkkmT7zG+sb/CaHgvQ5eQ=; b=gekrxwMMXSfiKh7X2MtuKkeuFV QAOpsgD7KoFm27hIEsSt+DEHF5EVsoe+1mOxqnyFtmoeGq1L/Ff96CHAzqud78wl5Z4SASZHAHUyh YKJA4u2OR0eDjoe4EQII7uoPlh6+nxs9qbGP3xjMxPcpHEpsQ9LcBQKLAFgOwnp860ESt2S9egIrk 72xLPVxF+Hhv+mMpWc+fVb3PeV617ipqga7qYwJd3kI6+W3Q49ClADPzbANi9wjE8NRNaieZ/kyZZ ZGMo8J4L+HLKxoNpmyh1J7gitTVD13H3LY0PRvDK4ySpnDm8t7hnXDIZWHDvFs7RTElLk8TpGkqga fTnu4hhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRMh6-00000001HAx-0k76; Sat, 28 Dec 2024 02:36:48 +0000 Received: from mail-db8eur05on20611.outbound.protection.outlook.com ([2a01:111:f403:2614::611] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLRB-00000001BJ4-2HZE; Sat, 28 Dec 2024 01:16:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=v7BjqXQfM67sPkUVU8p/a6OUUzCONkcGG9JgkMe/PmMIeQtUivzj/EnG5J50tDl+/wFg4/ca4MZSsNPzSpOnkVzyt8Ren4XSdguF9vgwHPQy/xMfASSO1b8BtxWznwOoJuQUiIYKnAzzVFMinJrlwb7rF9CLD3+4YHNgvonCaN9xjLriv7Yb2UJk739Y+GIBr1t/IuUP6Xot0bi6yDjhNAhS0BbmMgS3k+kzRHFqV/ULzl475z2R+5uhk4fZmq6eKrV44uxX2mySIo38OwnK/G6jrPKlkewmTK5lrnZ469jcJ2z1SRSUwccGlaet0GQClx2SatkzjzpV7sJGlVFriQ== 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=jUi4AC7FKXkStWkLhMCJK6ITtvAugeV+cOSxWiwaW7fmenKLpYY7RPq7pOAoiFeHscel61xZEdpW3AoZaTFu8DAP5r9TVBKHG43zatdo0tB2sHfWtZ/KsJ+cs4zXyr4U9t/eX7gt71dKF5Z939vD3hdHOE2qDQQA4/qyEqSw37EmUIvvDV4k8/Sq90vPBMYmXg8uAnffVqtIkmnRiAIksdgiWDYBkxVurxjofSZn7uFnuOhzL0hql/fbPVOcwm34TS3Nr4PNfMqvdMnSrRmmuP6TanRxN2P4i1BKCchadoI04RLl6SU8Sp0rNgjfXpsULbpwwh+XQCXGVmE71pD4aA== 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=L8NSaMO5bMY3D+ZNNkX9P98p8/aWXPNZSbUcdrvrKlI9jvJU/QAcn4ncVGKm0wr5VJl4PODd8Z8bSxohG2Bv6H2xbDR2FiaTcRhDaKnVscLVzmdERpDo/D0KkHZ3ij2ByV8+AfigSM/NJplkxfWVUMF+iulhDX1GirbPETfffm38glLKAVv2nmEwrWdHbr9JAePm0x3pbdH9N2zvrALFQsltQRPzI1mPaPrMhFsjVvxJ1um6qeF6Xy8Iihm37xTClw1ewV8Sfj+rKurPmyT1v+wYGpMtcVeq/1S0aTtQfFdIjDzvPC6k4jpWTq4YI5j2fFS++lFan0D0yOSC9CBlIA== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:16:10 +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.8293.000; Sat, 28 Dec 2024 01:16:10 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:47 +0800 Subject: [PATCH 11/12] rtc: mpfs: Use devm_pm_set_wake_irq Message-Id: <20241228-wake_irq-v1-11-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1347; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=7sZhYfT/a75JkuPsULgAYPAtV5pnc5lWQRqy0mNIenc=; b=C02+WNqxKfAAf7mHi9bvaN45rY3SyyhH/d2aF3re2z0PhFA27PAuCbEo4WSccOkmHtNlPz+yL QsNBVl1prIIDgaoDXhtnsXPRGmUvFDBevQHs2g7/KFmxAsUGG0hhVGu X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ef3df23-780b-404b-c7b9-08dd26dd36bf 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?4kbzgfbI9uLqQSZuEUWINVja891k0Ix?= =?utf-8?q?8liO4poF5D+YLjlkSTOZxNeTsRK9eZe3AHiaCjQljqBZtMx+fgtdg9Y7I9gbf6Cu7?= =?utf-8?q?4b+yPqSmgyZzR+e44ZPNoC/2kysG2d8TQLKU6u9GET1jKeBJUDDtj8/wlzF9jXRKo?= =?utf-8?q?axub/mqW2uqJg5OZh1WXcqCNrMidjUrOzlB/YxL2N511Yq+dohSqB5RBn7LnXWSQu?= =?utf-8?q?a20qkP1FfRIZrbeXAzAJQDmG5TkkogwCFt4gGR+o1sN2hmRgTdlkiX7g5g9JPgeyB?= =?utf-8?q?Zi+2exJU9Oo2slVYMMP/5BlgsItot5y8gPJIwSmHNgrthPaBt4AbYhfPC7jx6/JGL?= =?utf-8?q?2y4LG2K7e+GfDCPmE84Ecp9fDzG/T9z1ZcXSKAAHSO2+aviasJPAVxjkkyXsJoRrQ?= =?utf-8?q?R1wg2GKo5DzZSqAEcoVC2eQTZ1sy98zMhJGyzSJtOELgshCJCYuwqGdkrjpd+6Qdg?= =?utf-8?q?s0wJ5OQbvtACfZ2AOmFpG3DTAE7zLmmUA6ToyIm9KO2iMxpQUzMAtXWLGXk+Ha1dq?= =?utf-8?q?klC7Gi3Dxe89G9sonSOA1Rr2ggzJXGh1GQXREiRgzG73YbHpJ82PkHH5GRtRKpr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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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?+G46LiHu8tK1Hr62jz+ZUKu+pQqo?= =?utf-8?q?ihFV3w9+GBrokyqCShrx8cemvC1Kxb7RkJvEAvAp+bH/rU78249ndcYRPmz3JaizM?= =?utf-8?q?tnvH+fBdgTIr8bid3eNmd9q5soIBxlCLrk87/VZS8jOO5pC5w07wFJVLEb3aoATQ7?= =?utf-8?q?TCG96OWUAaRlfGwmV5dWlr6XQOzTl6wiqYEsufGX4Y/DIYKASjMjncUBbAZixfh6s?= =?utf-8?q?FFbkhgtrPSDE9m7Ac5wE/TZprYevm78RBOFI6AtFe14e0KZDiRJV9KPBH8PZ6Fo6H?= =?utf-8?q?8NQr4/qSlHFtSbI+/9qnZ331u6PW4uaSURbyKrRjzKy7kEsOB0SqroSUzi8KHtmwT?= =?utf-8?q?QjUqdp53nBvnbFh9AyY/Jh41QogUf/b2I7aYUotHlGBbr7OleGQJEHCUgvLXHlqlq?= =?utf-8?q?DxFcDaPif92kUtTUxKfzOMhih5sQU5P49K/XALmpXAiACTjTdxMmBpUTypxvGvDEm?= =?utf-8?q?ZakxklPdqytrZtvyNKA0mk8LbA1CjSfX/Pyh17yXGAcxeHrEwZoNLw+kcd7+nbg+R?= =?utf-8?q?WUIwLTI3x9KWnq2Hm1udTQaxJeb4Af6H3Zj815McT8gGLELkSBaRg3IQy7kx0dO0R?= =?utf-8?q?3RF9ewRQGJqyyFuTMIDcS9rNpaMigdM/jR/0hWI6Ao0zRRMAaHpljbHca7x9KXr7L?= =?utf-8?q?j15BSv+4Dcu9adIEa+o5ip+J+equrLdJ7t+9jpGALg0EjsOw6nDee92lV0cykktgi?= =?utf-8?q?iz+odQFETkvdPqtBsjluQT4uL2qT3VVaWglGazRfht9SEm+raZgcM0xxngC7wNmP/?= =?utf-8?q?4RwFhdCzmR+hxrWy+o0+ID4nEjAZgpNQfeWwgIHiQ3dHh58gxNYYoNC4lpH1b19JN?= =?utf-8?q?tmqYeEZnjBZyhjc+7slMSACEFalgRuBaRtlgoibM/wY6hninaKjXn1QBK6X7e5Vwd?= =?utf-8?q?S1u94wy6nFKzoNDlML+i0z5B529OzNnhVANIelGpdmQokaDOdQdC2HcCEQYLmwyQj?= =?utf-8?q?nw4veAYCji+qIIPZDf4o8kh6FMzupvyTxi3VuMv3M5453KTl1SD+xatPLhPUXfURf?= =?utf-8?q?1wVI/sU74Cc4tkjM2h3a4exUkw6k6DYwhWf8PYyZYiVE71EvLqADDXIOPYNUwLcds?= =?utf-8?q?xl9VzJgHGRI/ul2UJz6+3RnkyyJIb+FoKlsTdnmmaTeDIEMjFv3/LVN1URwl2mLoo?= =?utf-8?q?juYD0q5BauApGhQwrVtYhJMHHmQ/JPxqT+eXNutK/zR3Wcc8pKgt6sJmBp+4BgLfH?= =?utf-8?q?QS5s/el+iT4+rHE3fITX2CyyZbF8XuXmrBMjkmqAFYD+OvDw1U6JotFJTxwFOL1MA?= =?utf-8?q?SNJyRp6ihqzvnfO7FixyhaMvaZKMZACUJZXhXc6LvoF2eviWSeqAMPTrsr4IqjyDX?= =?utf-8?q?607ihA34Uu4vtIn7Dzy9uhFXmmZsqkXm/VmI35VfdxeJU7aJ0blwD1z23Y7p40DHv?= =?utf-8?q?JqVdxe+NFOnp3lBkPLPiBKZT5wh0MPyg2oopjFM4SLyq/yaektQ5bXoKpapi1GIUA?= =?utf-8?q?7QMVX2CzovhKDruqyyxSs0+WeMLLkVewsZq/gdvjYbZcV6AzkRbVBi9wwXWxixUSb?= =?utf-8?q?JY0l7xVzoye6?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ef3df23-780b-404b-c7b9-08dd26dd36bf X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:16:10.5601 (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: dSMkfeYsXxTgqcNrLWKeHIr3wkAYAF9gNGHiTcapqOUgG8r/cQkn61igxcVN+NC7nOV/kKRKGuv/LcA7+7L9OQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171617_594350_45C359FB X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Sat Dec 28 01:14:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13922239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E7E3E7718B for ; Sat, 28 Dec 2024 01:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=oXkiccgX1mXtIZuG+nIrpUNIHNsrddvwDKMyk+V2Ed4=; b=q2O8oavJ+3KtZJB44JFU9M1gMw qVbFoXFiiyVToGPhpY7YWTl9oaMAeXEZ89q4K/8r5l+G/U2408ucRW2W6AuFkbJWTBim95/9im/F5 ZXyRA0dVpMLI2AswLzDBBUQonOG8gYYs2pS7WT+eAZkt5aozUw/ZpgOn7JIf3ZLIXguBJa8qflkpj CBBAFv/FIJekmObXKkeahdV0ympGBeboaY33qUkJC7uT+CNAJHX+x6Oi3/98cSWqGlvkH1Mn9o+4Z lIVtoEeNwmdxLvkr4ezAA3U7jreM/n2Z+lLHDq3oapWOr/KJbvVY7Y1YYBFqLMmlqzLMioWh5aaV9 yAeYyVlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRLfb-00000001DPU-19aE; Sat, 28 Dec 2024 01:31:11 +0000 Received: from mail-vi1eur05on20627.outbound.protection.outlook.com ([2a01:111:f403:2613::627] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRLRH-00000001BL0-0gXH; Sat, 28 Dec 2024 01:16:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=icYCs2ZqekGd+37C3M70wSGEHi/HMxj7N47k06vMhgqNf3RLegI28GAMzILY36lrkRwRwHGOVm1xYxRMWhfi1RK7sOrE7auzvXlviX08nkVSiSJGzW6Epc3Qi8hQAJZ9Ww+l9jyg3t6fgxh3yesIl/f5l/PvT9LJ+H/ramAsd2PFqZzNFYNWMvYvY/7EwlvNPNjqAgr5sJTLNTLwGZ7y2jPITWGV7olA+RWg94m42NUxfpw3jED6+Y7PI814YBt+tujJKWs0dIzvXyjZQpInzbOmBoQZR4fWIhcM3i8pJ4TD3rc4u58SADmRVezauXlDzNPSp+c8OE1oTzefoMgrIg== 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=SwP/Z30a82zAkoSfiP4uYDFRLsAZY6IC2N1v3ZTRi6g=; b=stm+2Gd5h+s0NxVf6Bc4aYom35PzbsbFxb9TBJT68vkguGCNVjpus5+XpcW4XaPfN5e8lLCupYocEaJvGAX0NklDzEfDiCQZNP+36nu1eoK6qvLjDJyzovcEmO37kkI04kpLhVDgKtKd9ylq8Ax6A+xn7a8OkdrywB/cxpUCuEb8zrl35Qx9lkqlbPW7rPHFx1toFCQjuYhPyNwM/zfqXkepZ/driT17ssDEFuigPsjZ78V9U4S9FZYEg8M7oy4tpoKbgEyT0Gc6hjDQHLwANiDKNQaeaAaZYnaCMzWN/7quyvIZybN1JDj2ppJ/Qyz0HgP3dssRiqnlHxwUmJHEcw== 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=SwP/Z30a82zAkoSfiP4uYDFRLsAZY6IC2N1v3ZTRi6g=; b=KqEwJo7Yq93VGM33epmbmAouJdXGLda3Q6Sdt0z+hOHEeDX+ctzRAmeVQpWaHQH47WW+mCBLXpEfEZz6uroSsY6C50yRHReawvsjUyZcoxgS8+Gy0MtA2OE7ae9AQ4xjD6cTbntH/DbnsSHHhOxOHFqkzbr7lx/xNWoFNxjmMa8DQ68FjlneXWBefp9I+DaynJqlHiInE/Jq9YcWjmgVOtqFO79vJMbe7Y5r2isr5DLLd4Xse3q0UcxxaMPTRTIuofwp0mDHyF6jlq+E1HQA4ZirwNKcjj9dy/1mdDKnmdYN/gXx8pug2qDPOMmJhmWVvb0zcRgYEmoBHigKzjDTCQ== 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 AM0PR04MB7140.eurprd04.prod.outlook.com (2603:10a6:208:192::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.15; Sat, 28 Dec 2024 01:16:15 +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.8293.000; Sat, 28 Dec 2024 01:16:15 +0000 From: "Peng Fan (OSS)" Date: Sat, 28 Dec 2024 09:14:48 +0800 Subject: [PATCH 12/12] rtc: pl031: Use resource managed API to simplify code Message-Id: <20241228-wake_irq-v1-12-09cfca77cd47@nxp.com> References: <20241228-wake_irq-v1-0-09cfca77cd47@nxp.com> In-Reply-To: <20241228-wake_irq-v1-0-09cfca77cd47@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=1735348488; l=1402; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=4BMfK6zSQF5qiBDmk7U70xZY4AnsGczgpoZ/YOkhF9U=; b=pUt4U8/DoSsmmA+YwURboasmkRyxZrbgsS72GSgchx8AvlavLmQcbowWHUf60rQ6f87O4Xu1H zZb3y56hfH4CqUdatq1mfS0i5ZTetyxBOQORYjJzuxq6HS9oK+jnXae X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0099.apcprd02.prod.outlook.com (2603:1096:4:92::15) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|AM0PR04MB7140:EE_ X-MS-Office365-Filtering-Correlation-Id: 6455ec2c-8348-423e-b75b-08dd26dd39d5 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|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?JLihIqFZ9vMluogPwyag3rSvN+LqC1V?= =?utf-8?q?0E71g5sxJWbp50oArzM9NHDltGyzAzrrlTMwx8wVB2PjOy6beYzjnlJET89tvc0uF?= =?utf-8?q?7MNT4hBrNFVGM4FdFav0aZR8iRjNmw4HuIYSE5xsF6D6e9u66s9hx7LHPJRFThRYa?= =?utf-8?q?Wvj7H2ZAtgU55EXNqx6/5WFXGZMwd4izKruBkxmS365B9/uAiXEAVUR4shm4Exp9t?= =?utf-8?q?8nI16I/3Qk5/BGvqR/9L+qdcPoTxVOpPXHz/pQJpE9Mwfoz+1bbTDGsP6mKiXUOX8?= =?utf-8?q?hhXNxRDJX0zIqZyogzafh/KjMfz75UEctlTbgziOaJ54peCw/hb/SM3jC1JROc/Md?= =?utf-8?q?/Gq5AeazTSaDzpO1FgvaHuO/T4VBAUA7zlI2Qgq6aIEJ6bnBvS7myi9NahR/PwzQV?= =?utf-8?q?pVCTvhYbe1Q+pB94z8/7dKNkLKbR5aQC4n+QJayfqf9DR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=?utf-8?q?TW5Lwy5a4YvMHU6j5iLt1uFMjLH0zhlis1ip/KVobNI8ftQjLOwJPtbq2DnmFyWoa?= =?utf-8?q?A9WyUG0l66sWgkHfCxqz1Wco4PjOm5eqQ=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)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6C6oRtZKKArb3Orv2dKTbdGxlhyM?= =?utf-8?q?kBLeESysWgevdH7cF4Nsm3W0QUuTtiarfT4ZiVYJhRsHVG4+X9jN5au6KR2eQfRWk?= =?utf-8?q?GuLRf6N7wpBKdQrXemr9O9TvrE8w3m4koBP82OaAKMHWNkuSWtlvY90FJGlOCN+w8?= =?utf-8?q?k/dj+2Vq+qYfEsMeHQu+ngsrsqAKYW1P+8FAP3gbkwylvcJw+hKer/LpZPxIAt/sV?= =?utf-8?q?Xm1U4VCbo01ojMphgniMiGdbnzPrHput3jijhIKs2IahOQmGs/AU0pcPbHaMvY7nt?= =?utf-8?q?IcLOLvkVYMeCMLhyJbMkpmvybGvVhIns5RsQiyHnw9Mf1ruJmV3AMory+YDmUFq3D?= =?utf-8?q?Dq8xuZIhN74HZ3Knni5u7nrmS5Gn9V/XiXlaz9ABXT+taqViIWTyDAAA/e3IdjU7Z?= =?utf-8?q?ptJXhTmMeqaRIXVmGeBzymsij2wmQ7U3cl1PAW1bI4L16JIQjbLL3xkFwrISM2+TL?= =?utf-8?q?S2fFY08BjQ/LNOM7QejIH2rXTrH/p5t0NJoaYxQj4AJ2SWp3NJ50+zI3I7LeXNQ6a?= =?utf-8?q?48Cc8mqyIcHlRjD/JASgV3UKgXxEGI0b1PSYsqlwIda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86pKsQ6FiPig4?= =?utf-8?q?RHJjf5BAy9WfkBT4IU+2O2wIBQy0DE3zg4si0+vEWPIexSi4UJOyTN56MI5yW3r/h?= =?utf-8?q?ryfPcA1lHOQq?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6455ec2c-8348-423e-b75b-08dd26dd39d5 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2024 01:16:15.7255 (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: KFUTPpyMWHKSNY6jE6x5gXIMv7hUjizTHKJjCWoGhzxl+RBGvoDIzRWrkNYCt++ZS1gV4fMvqstQmEUt+7Zb+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7140 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241227_171623_212982_39A219CD X-CRM114-Status: GOOD ( 10.23 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Linus Walleij --- 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;