From patchwork Fri Aug 30 09:41:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784818 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2058.outbound.protection.outlook.com [40.107.255.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F69C17A918 for ; Fri, 30 Aug 2024 09:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010900; cv=fail; b=Mxm9GCcano82ZmDxCutl7BsoHirm/U1LoRXW+UNyBsCuJudQzeTCnaj7uv1x7EbI9U5pG2EEvX4p/2NQjdQh0IBvqnpsqfAvlUyrkCvyKub8yPPzs36fgV5NOPli/nDPjVoejeY4g3U+YRJL5YC+faej3U8hojw6tri6jAWL/P4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725010900; c=relaxed/simple; bh=jfi+PYlezXIYdcXyXSsJ3qi3KooHAW9FCaDEaPD+Gls=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=DFyebT20mPENY18BdtLZ7pF9Y1g5ZHFvALdjZX5ypsx1zAfzNVO+TaX9f/SgNqGF2qNRENriR52mYzN4hUmeu/NZVs5r1Z7MDnqTLQ1ziGT/zhSxugCK+mIEz4rIhy06ZLJ9mChgPegubwAxLXpb2k4eTay1AI6mu001LZ48jNE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=nDl8bTys; arc=fail smtp.client-ip=40.107.255.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="nDl8bTys" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vp5nH/1aBwoHZf2baCn9WQIe8Usx5WKXii/LOE91VHX6I1rPV2fw4SiUyzKuuhLXbV9q2iRfnkKQaDKcRI0H6DRWsRck/rTLw0kb07Ayg7VySChpnIF76kvduGIHIHEioP2vZruLU3XzYeYL+v/gyrBvddDqNAcGNWdorzZsI1uWjksNGl8fUFOoAlNzJn5Q7m7N3EWIh0skhVF1IXWyoWhHu4h6x1IcV3/W9HFsRdp2jx4gsAv+Jhgb5YiVOH+zT0IkqU6ktec8kUNMf6WC9tueeU3+HCGFElzyuMHTdHxUYESohDiARU0AfCR+5REisA8GchR9WM8ZFlDYnUkk3w== 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=Xs7ILw0SU9agNB/gUeCNtevHvf0OowZW0mDlK9ZWENI=; b=giwRc4IjJu5NrgSuIwkoRweyvOw64Rfl/Vv6V/YytwB62w1DvuvALiGV6/B/TjsxZQ1bX5b9TEQ/HeGawMLkyumHwlIczga56auHSEp2HlogK+1hVr7AOhZnHSvW/RmZ7DtAvkdrvQnWPgaVtUqhwLnj/MGVO5xIy7Km+fSxo08X70mWO5ckCje7otq2qR0X9mzACErSLWHyGKzDHiPmNNpRI6TzsKZDysRCHzC1kw1HdM7c+FilmSGHnD9MDCEKto9WxRC+FU7FYaAZ3oHhz+/7cn7c/H7Pwqo7ePaxPksOkOnCVCsWgtC8gNyW6hq7YsUXGoDbM/tGsPWisp3DLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xs7ILw0SU9agNB/gUeCNtevHvf0OowZW0mDlK9ZWENI=; b=nDl8bTysnaroF+G2Z4B64cygNv1O44LUD6SXy98uDIvC9KizL8sTwlutOj7+Q4E+OIEQ/WNE/aygvlmMPO2GKESKowMnO6WedhLf5B28y68wIi9j7OI1EDFMdstsyPbXSZF+kIBuQa9+PhMRhSyVQMaugne4z46/KCnrcxtczjRhfHJ+APRhrPMx0NJqqPXwMunrp4wEZ+DT3NygEm7eg2o54+EOinSpi0IxDUSStpXutfsID7y/pG77RqfPwPFwoom3rFZIh40ntrFoU1kOH0W7tMBNChtNqtctOeL3CO0Et20A6oLiEURgV0+81kDioz/tjjHApVWsputgPV/k9g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) by TYZPR06MB5203.apcprd06.prod.outlook.com (2603:1096:400:1f9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Fri, 30 Aug 2024 09:41:37 +0000 Received: from SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6]) by SEZPR06MB5576.apcprd06.prod.outlook.com ([fe80::5c0a:2748:6a72:99b6%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 09:41:37 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Liao Yuanhong Subject: [PATCH v2 2/7] dmaengine:at_hdmac:Use devm_clk_get_enabled() helpers Date: Fri, 30 Aug 2024 17:41:13 +0800 Message-Id: <20240830094118.15458-3-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240830094118.15458-1-liaoyuanhong@vivo.com> References: <20240830094118.15458-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: SG2P153CA0020.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::7) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|TYZPR06MB5203:EE_ X-MS-Office365-Filtering-Correlation-Id: 70b3775d-4135-40a8-ecb0-08dcc8d7f12f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: /fMZ/H4liln4i8WU6KPPL4MvtXgLwULoFsWE5fChkIq1Ou+ByZfiGY9FbKCyy8NujH5UerBCLpG9AfvrNQ9X+b1BhaHgBVWmiW77VhYd1gzAqZIOsdekRJwNYfmK2E2nMjrV/6Ce+SMJ5gBrv+x1hMz6m4r6yHKsZrc1oZ+BJrqeF2z5GsmEdtfC9u75LKUFQG1rCTY2cWKtUypkE9EefJrcbRGDlX5fIErJeQkSTBdMijHoaiLYxxVH4oY1cCreX3zxicNKZqE1xvbuPUqfwCoPAnmfY0zGW6Wnm4T43WcfQIA5MGhnEHAx+uWguQZ3DxmtmyPJdbdQ32r6EroYtI4HTriGJaw/O4HzSZFCLsiCDQfGiuIzlei+0AFyDvN+zRY/x4Y4iGum267s8Ga6F5srByZjSdBR2MFfnD5KfXxWurUwDY/nbMKt2fm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ZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dTdyAZosUHjMnsdEFb6i+8ApzamNBWH/bKY+buGF6xhIeMu5ykgnDJQ1maiWFWPhfGTSW0KMBxv6y0FFeACVRXXqN4foYNfAD9x4LBh8mqNC2SLjvavWtOdM2LcpjGH8D7VgRP3E+kD8N84JYRAzpMQyFjNt+BnXRhc1CD9wznz82kc0b4iAI7yP2eEETqggJdpEZDv/NxRLPN9E+vQEZV2BxSq/mpW36td0UVowbS3j6b1ZQIZkXfntP/W4NBmUr/83pPZej5OsvFvAPJksEbrhw7GNBMCvkOeHP0i6XxGKLkISXMZ4ONXQGDoHT805SvmZZRgTA6xXuTAM4xRNsYHiF1n9aWlaoG/8os7SSDPsFQd9Tqqv1cbpYgcmXAI3OAnvI5h/dbgL73vSq9czggXwbx2Hg1+EHLb6gtXpjGuQkZ1qYTlYg4KQvBaUlEHkgHFMQuAO+GMDKnbzmTUHfNj5PzOTZYqwbmyuZyBb3YC9YrMiCTUgp/cDcHlNWT0SUXu37v0MyLek0Bxa/0IYmrzzrf1600IDMyJcteuPMUMtYAuF+LQkSXtdHDO47BaH59e0YctHdhsXeqGmOK5QgkFNRwyl6AnW8jNSbMqx2BXFPT1PMc4c0+Ne1/2EoJlrflfJ5Cak/I3roDMQ2zWmxX8+ZIxxpstKdMOAP2Kapc29gYBZSw3M+xNYRZjbzWkDU5nmRU1k4ejLbqZ73W/0oDoorPyGDINoQbNiuVe/ALEF1fuVRgCa7dywY5E0sF8tQFMa0uLzvUvUhMqP0uj8Cm8y5Qc1KazWUJlJmiH7MdOcUfItDOeAp5oF6VGRndZLAElxV3fhEDt5zI9wBfG/g+Q9gPOF0seXihtnLjKcEgOQK0CHIxfDrWaFYAzj5uw3JPpkA6vJ7/yH8EDK66g8vcA3bI03L7Jj6cP20JZOLsK3sqbEpvsIH+rmFI1SrxgpyCXwip3O3wWO6BIL8ABaOEN24a5Mlug11ZCcUAWLNB1r2eDU5gwAC1DDktQ9yzA8WcNkmmpoBsCS6YumUrmNyu60EhmVq4hPNGV7cg9RN9Jw4u8tZVa/txilP7myGPN4+tMrm3RAunZRLumRysyg//jeeGehPdidX1KfiIDdD1eDtA3EkPz8T9JWqYv+Efn3b+MN/O1k9e1UdnnifukL2uzpKSO4DPPeLDSZYa+lDR0cYuy2KnM2iU7jjHhV3BFbm5Yy2Mc0/kjL7Sa448eBw3SmwhEZ9mAWKmofDhvoGypAX0dPp0VpM0cUyuecBkiPfHqXcfO0ERdS0pHRU/S7dBXz1ssWIcyk7WKvQbpyYnawo7Joq5tTFiWsjyxc39IXIal7rsAAbk1GiHfpZ7xRZEBwmavEo9uH/tiZvPZ3/32tjvXcBI7UK2H/i7rCTpTPKE6K5qKx0RoiF+EmeAMgvrwPpSms8Tf9+63n49CXJD8Jv51ATyelkhlVEzyq4g/Fb8FmBDWwbZusIaeZnidej7xJsgJqQ15hHHK7qRwcs9tNMK1ac6ixTBJRH7DGeMlMzAKplv98LGRbxTX4pgYRQu/rFAOl28pVA+/15VrKCWe++5INmzJtSBuIDa8J5ZRE X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70b3775d-4135-40a8-ecb0-08dcc8d7f12f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:41:37.1321 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: itNxbKJ8YjB6J7XNXMBX4RLR76wvwjIQsJEUKOLkKTuLt8w2E+qJt+nieHy7CXOGNBkMD0nTw2U/Mm60Rf4sYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5203 Use devm_clk_get_enabled() instead of clk functions in at_hdmac. Signed-off-by: Liao Yuanhong --- v2:remove modifications related to the resume operation. --- drivers/dma/at_hdmac.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 40052d1bd0b5..2274aeb58271 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1975,20 +1975,16 @@ static int __init at_dma_probe(struct platform_device *pdev) atdma->dma_device.cap_mask = plat_dat->cap_mask; atdma->all_chan_mask = (1 << plat_dat->nr_channels) - 1; - atdma->clk = devm_clk_get(&pdev->dev, "dma_clk"); + atdma->clk = devm_clk_get_enabled(&pdev->dev, "dma_clk"); if (IS_ERR(atdma->clk)) return PTR_ERR(atdma->clk); - err = clk_prepare_enable(atdma->clk); - if (err) - return err; - /* force dma off, just in case */ at_dma_off(atdma); err = request_irq(irq, at_dma_interrupt, 0, "at_hdmac", atdma); if (err) - goto err_irq; + return err; platform_set_drvdata(pdev, atdma); @@ -2105,8 +2101,6 @@ static int __init at_dma_probe(struct platform_device *pdev) dma_pool_destroy(atdma->lli_pool); err_desc_pool_create: free_irq(platform_get_irq(pdev, 0), atdma); -err_irq: - clk_disable_unprepare(atdma->clk); return err; } @@ -2130,16 +2124,11 @@ static void at_dma_remove(struct platform_device *pdev) atc_disable_chan_irq(atdma, chan->chan_id); list_del(&chan->device_node); } - - clk_disable_unprepare(atdma->clk); } static void at_dma_shutdown(struct platform_device *pdev) { - struct at_dma *atdma = platform_get_drvdata(pdev); - at_dma_off(platform_get_drvdata(pdev)); - clk_disable_unprepare(atdma->clk); } static int at_dma_prepare(struct device *dev) @@ -2194,7 +2183,6 @@ static int at_dma_suspend_noirq(struct device *dev) /* disable DMA controller */ at_dma_off(atdma); - clk_disable_unprepare(atdma->clk); return 0; }