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 X-Patchwork-Id: 13922248 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 60440E7718F for ; Sat, 28 Dec 2024 02:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: 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=AlobrdkVfX/38MVJCt8Iq+/b3rUpD0WjleMSu5zbIM4=; b=e8Fv10CZ0aGBrw5UgRSivng3Ce AGMHAdMw80wd1JBr9P5zvOp45naC6p5VPdhycwgsIqSW05FjRwsWjDuTYmh7+3FbBvr8SiSbZMc1M fEkFlPDnbPv2Xn7i5t1yra9pGs+mFQx7npWFO0r4AKOzxeIpaNumO8ud3M1Ow+f0Z9/pKmM/1zAmm sGnFV4TEitrJbBNis+5CxFw0hXwq9j+wHoR3EJaz7scssUCjHk3vvVDjgsg0J56SRF6UMjuIL3kKO 58eIJ0RBHnmWJEm1D2LCzpief1l1QXxq0IURfV81hys2OLCe3v81xcOMGy73Ck+DmD6q6VpylTYb8 kv9+yMOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRMh4-00000001H9r-1RC6; 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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9XdKhos6mUfdjuCznGAzEB/BHXyQO5Bmma+v?= =?utf-8?q?9JGsiWxGTm3VOHOwsicNNXxKHVc5gnF/1YU0oz0Ozg+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-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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, };