From patchwork Fri Aug 30 09:41:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784841 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 6117ECA0EFB for ; Fri, 30 Aug 2024 09:48: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t//JNj3zH8IwaNVFP+SWjbF0AZkMptOSwtNFs21wFN8=; b=DX8gi0T8O50pGouezzpK4PlTsZ Nrs2+BDg5GYh4HWMgNTQsPFCR7GhIuS7q7OO0KUOe5xiOBv09OPm7SPxP2OhYskVoLFeFjCRfqsLh x3TaI1lzOx1+Utl9oDdvlvA1jO4VARBOA9NDlq904KYCSgiDivRjIutqESZZq/LQvtbAZsca0XQlz F3cpl2vxc7R/ysSrheCAeQtuy/1f1DDEBnRDOGm1Mtv7kdxYQidrBCA51Xq9lAeFsDkQw6vWtO0Kq Mqn9u2LyjAYFs5IL+fhYKVDwrjR6C7+VrD5Hu+8qnLWlWZQKeXfFTgoNPr0NX+NpUOfMTKxB/Tt5Y 5tHt1K+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjyFH-00000005dLa-0DUU; Fri, 30 Aug 2024 09:48:43 +0000 Received: from mail-sgaapc01on2060f.outbound.protection.outlook.com ([2a01:111:f400:feab::60f] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjy8m-00000005bqU-3JVA for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 09:42:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HSYmhSsXkwoRlY+9WiDr2sNJFf8Cm2yhTyYnhqGeiYiAPRxcK+YbTTpGB8rSYGXZGyLFPCWY3hGgIfg6/n95erJ8UhgBlAud6jk278usPyItjOF0RPWLp4skXFjbebvjVeE2FtwZ5WGOVaZRXAjGpVRCk6ECM5azaZe/m3KBI3yGfuznhdE7jABBMFA/mJrAqnXEA0PV/DBjm1ZI3q93vIovInSgLiDvvZ4z8hxVq0DwK61cWUYaNszhRfQ8yoJtO7w+pX9bSJQAwkJ2bNF4fbRMSI3AkzSo30BBUqfZ17I+gTUWfPOXprrsoDJ9lLP0ffDfKs1gdcqeuI+81flCsA== 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=t//JNj3zH8IwaNVFP+SWjbF0AZkMptOSwtNFs21wFN8=; b=r0VAMUj/lsVS9qQAXxCn2Y8EJrsDOQurqdBl3T7XtfY5CrnCPq/fTvnFT+K1nOjHuIxWizpt12pmMGtIfwdABZdUM9g3OqHaRCua3hCMnpKHkLweawqKef0LF4dBBj6EsF1aNVrtxYNEb01u+/zXQZb6jHvGbz6a3IlzDTmcXPgSRBdXFxH7+hKg/Y+XixHIXR6r3UYoz8OzWKt6j9ScykCn/ELf6V/VY9GphScN000lbgofRR0LhzzwSOfJty3WCIxxLdBh5VPfxE5DyOMc3qMxN0XIpXMKNaRKBGws5rfH2GvAn0DCiHO61F8/UozCEClQ3bkuyC425icbD2R62Q== 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=t//JNj3zH8IwaNVFP+SWjbF0AZkMptOSwtNFs21wFN8=; b=XtxBFWPdZ3qgbJQokCPN0pBrTEgTifwpkCIBfFr2WkO+doshr2DsBfHka9rlq0Qw607MdEbuwoEqu7F5h9qojSrlOg78pkRJV8twEIQvOay+1nsk9f5L0/aggpavXcQDLeZVzW7ITASQVXMm4/dOQrnAjVLnSLInxhf5UwH05SEvMFLP6lnBOVWthP8xRB9P9C9JK5ywErE9YGTFfQCWqNuH5/RaW2ZSrBjCX8GgUeNIO4I62+cHfC59FEEwRaLjzKd2mNz0hUxIo3sL0b+7JcEnk4jAIz33eKUm475BlPQyE+EpF7TU+hwJJGnsiaOHu9/UqToKh/dbqlvcoGIrtw== 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 PUZPR06MB5619.apcprd06.prod.outlook.com (2603:1096:301:eb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 09:41:46 +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:45 +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 6/7] dmaengine:milbeaut-hdmac:Use devm_clk_get_enabled() helpers Date: Fri, 30 Aug 2024 17:41:17 +0800 Message-Id: <20240830094118.15458-7-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) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|PUZPR06MB5619:EE_ X-MS-Office365-Filtering-Correlation-Id: 81e644a8-0bf8-48f6-4d72-08dcc8d7f65c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: DCi8l45U9S1sGJyWBTGuZAfwxqdWaS/5HeHcBJVYh8tLyg2h4NRLYRxYi37+yqvTWn+R1t1yavvwyWFkemtXk7+pasmy5bxa+ARNiz1gi1yKRQy23Y0LZylaeDwusafRLh/nSu06hkAz1jBQRI+LfYCK0qpnBbAJooEPktA91JCxoLDo9sXm6zRM/SgwxBZ4P8g27dviSvBKjVz9/i5JIT3Vd6YP5LC/H0KOxmAYUVQ7xUuoRSHVtMzLSAwcnKdaxiJ9cfYjjFu+Dyn8F4t5oELp1Zfc3OTP3kC2eWAYE0BQYx0jv+F5OF/WtaaoFPM+hRgAuGdO1nnhcy5BevTrOWmusjv6puTYfTttxntJQSIbK0PjWCnLE6gfxJkzO1Egc18K6olrCUJVeFE7dsmXDwNU4MZ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EZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N8urTLkx6frbiFvLyis1bbJwXFC0UuOblQGH38DqJKLm68tLWjgcEtYJYaUa71GhnA72uOmoeiMFvTy/pA7YI+4XBVZJsZR215Rhtq75y+Pnxb5F5mqgKCiRD6479/edV2G/MEC0b63kMPfN8jvfAaOSAhjha+vKDweHtlRIEwwU8BUiIj3SohojHcMk2AezDCw6Tq8aaPaSZVbvw6p3pauZjb4YGGWaMTyfbzwHcR3VkaEkqX8Z3u8IUjkEWGLuW4pbB8DLxuk8ohLRB8tKX8HrywynJoyM7LWgBSkwzHCjlVpBsSc2LrwKCf1ESwkrGqPrYrs8OsTObueh1/B9TeZqkXPF2iyNGSSJqDBcYcJQQyBD/Lo0JH0Dr/Ba4N0SZWrj6kZONbkdibsq3WD2Z8Dh+wkHP2/RiTPFIDhptBz8UJv77A73F2xFcTlvNpXlBPjzqXm9NUKnG4jpTZXV8UdEKzM1RFqHTjUqj0p1suS3BBKYbhVqI4+Hkw7assd8kc/yUSTi/WwvKYhwTeOugQmVNFZ3vJlHyYeQsC8JCGVLUbxIo0BSyb2x3hGxTuwqVkRGQzel50qvVLzztItibRMJQFmuwUKNWViZtgq9pCVQo1oh4NBDpmhEbAJoCD5iXbxHaUJFcXFVtCHZMFwIoZXSdatALt3gSL2xTKGcPdXdH37/mmFHiUXrHEjjcVapj3zRS+InBjNJBoF+gnbXscESrgQ0maV6mRnTnMaXPtg8xzTfG5sJiP/CZEyO6yfAMWr685GgNc5bPu0cD60ie+rnWWLb47jRjJEHCUpI6mGBphK/Dxs4GgMrlhp1hRTvokZoWX7mx1JTHy1SsbEPfpPgl3sOZrcwUGQ87xCqrfMvKZg8/f+PatSJm0OD4AYsZzHC+vjReDia4TSSKtYjLF5Az8U08vUSRFawo97aU8EMyuk3sWGQ+/+bm0lJbWyCcdE6MNYd/R7vE9TxOk6qb5EFaaTrHFn+dhyt742lgSRRO4bXx5VRBp85RN9LTUxE1wpTCaGW6IOUqE2+F86oWjnj7unZKqaQOK5dJ7qorOr8itNE0OfTk/Bf/Jw9u53Kyb0+U0BErIe6BcPi1maUQr0XzkiX9v3AVOKE/Tovw7O6iMe7i9W9z+mqY2M8m7FcSFZ7qYdgCapbJtEn6vGxABxNDSWxh7LDcUbP7nzpVOxVbIbNbcLxWRvNNzid9t83k+FGoTNoztxKITYF9abhtMoD0E/31O56KHq7CMf437hNQaCNY4CJ3rnR22zcFDELX4VnTl09Z8ZHW4xCuBoNV3YJsPQamGKac/NNt1hFcwwYUSulSibwAnLSp1bQXc88wYEOolVDrihNurgk89kIlcKEMqvRAKQeB7BU3MI+Im3Dg952NA4C4vT0bGs83jfzrVBv/zl/MLMy1+lvGwRiTUhlLdntk+1rp/iP0eNwVgHVTi6SEM+NiaR1lpLoTl1CK9jz7ucNW0luSV9tIZQnJYDO+7HP2EX6/PyDEUr1wVt2oJgD+nAm/cHzfhKSK0PN0+qmAfljH5U72rQrSHIbBtyjnerlq0SwK76VX/+kqkyXuEl1u31itwDyW1Q1kuJl X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81e644a8-0bf8-48f6-4d72-08dcc8d7f65c 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:45.8065 (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: EoSUqAawA/NeAgmxffmoublkhVGF7qAqiYGlIoI5+8BEoafiyMVYzKZTsl5UglJnFpz/WR1CsO/4mFhvxC6M4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5619 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_024200_857133_6FC1803D X-CRM114-Status: GOOD ( 14.07 ) 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 Use devm_clk_get_enabled() instead of clk functions in milbeaut-hdmac. Signed-off-by: Liao Yuanhong --- drivers/dma/milbeaut-hdmac.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/dma/milbeaut-hdmac.c b/drivers/dma/milbeaut-hdmac.c index 7b41c670970a..b188bfa9613a 100644 --- a/drivers/dma/milbeaut-hdmac.c +++ b/drivers/dma/milbeaut-hdmac.c @@ -75,7 +75,6 @@ struct milbeaut_hdmac_chan { struct milbeaut_hdmac_device { struct dma_device ddev; - struct clk *clk; void __iomem *reg_base; struct milbeaut_hdmac_chan channels[]; }; @@ -458,6 +457,7 @@ static int milbeaut_hdmac_probe(struct platform_device *pdev) struct milbeaut_hdmac_device *mdev; struct dma_device *ddev; int nr_chans, ret, i; + struct clk *clk; nr_chans = platform_irq_count(pdev); if (nr_chans < 0) @@ -476,16 +476,12 @@ static int milbeaut_hdmac_probe(struct platform_device *pdev) if (IS_ERR(mdev->reg_base)) return PTR_ERR(mdev->reg_base); - mdev->clk = devm_clk_get(dev, NULL); - if (IS_ERR(mdev->clk)) { + clk = devm_clk_get_enabled(dev, NULL); + if (IS_ERR(clk)) { dev_err(dev, "failed to get clock\n"); - return PTR_ERR(mdev->clk); + return PTR_ERR(clk); } - ret = clk_prepare_enable(mdev->clk); - if (ret) - return ret; - ddev = &mdev->ddev; ddev->dev = dev; dma_cap_set(DMA_SLAVE, ddev->cap_mask); @@ -507,12 +503,12 @@ static int milbeaut_hdmac_probe(struct platform_device *pdev) for (i = 0; i < nr_chans; i++) { ret = milbeaut_hdmac_chan_init(pdev, mdev, i); if (ret) - goto disable_clk; + return ret; } ret = dma_async_device_register(ddev); if (ret) - goto disable_clk; + return ret; ret = of_dma_controller_register(dev->of_node, milbeaut_hdmac_xlate, mdev); @@ -525,9 +521,6 @@ static int milbeaut_hdmac_probe(struct platform_device *pdev) unregister_dmac: dma_async_device_unregister(ddev); -disable_clk: - clk_disable_unprepare(mdev->clk); - return ret; } @@ -560,7 +553,6 @@ static void milbeaut_hdmac_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); dma_async_device_unregister(&mdev->ddev); - clk_disable_unprepare(mdev->clk); } static const struct of_device_id milbeaut_hdmac_match[] = {