From patchwork Fri Aug 23 10:19:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13774930 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 40FE4C531DC for ; Fri, 23 Aug 2024 10:25:13 +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=nAIiRvIi1lOxnG91KjnyRmAZG4cwJZ1EK/A8vbDAN40=; b=M+27fg9mKMK40W2sVMq+mzxrpb Ltw09QVZwx4VwcjB1zPGsUOUA5QbWOAEqsxQ+dTobagb7wkLDa/oGjQfbfGBMGkQ3mXgBH47Sja6F YEKOceafM0yjh/kBvBahFts2bMPFfSn+ePJKeLNYy3IFB3xlOrTv/fcRpc4+eVFFqyRmWOzYf90wF 8dUYhvuoxfZZRMd1UuVU7LNuGq2hone3RJnyI35JQ7l/txBfLFqbczOvKTmUWLP7jChK456M1Idd1 rpNKfW4C05rKhNvAYDdagim6I9+XDYH2AfA/A3WzxNOOTWFJ8zaNuNcrXq2Qr8rkyHdcZQb6umdgo ZumL2kKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shRTb-0000000GKHb-3UOM; Fri, 23 Aug 2024 10:25:03 +0000 Received: from mail-sgaapc01on2061e.outbound.protection.outlook.com ([2a01:111:f400:feab::61e] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shROs-0000000GJ3b-2zSk for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 10:20:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pbDmUH8HZ5pOEEYK2Wgttrrv73d83TjAKacwe8n6AgsVkebqPrjzvwYfE7LMoiIpFebJrOEISVHnr2oV4UsxINd0xG29o/L2o6Uo/uvUQ+FJWBgtdCgecCb2CB5Pob4qymS4d2CtU8PIvgDav0+UYwwDdHZVDjboc7DSmvbmjrKyDa4I2B21WXW3f+uSAZFVY6KNOmnXjqvEsHT4EpBE4dHECcS6Ka/0aEWBYkZB5uWsTknFOr1VURYzAvZVKOQ6kD5hby2OFS+QBTPFQa3WfbiR0W+92/Vw162TLypofX7vGWU6tF1L2PYgIMH+j9c7/Xdg+UxhyFa+S2iypuy7PA== 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=nAIiRvIi1lOxnG91KjnyRmAZG4cwJZ1EK/A8vbDAN40=; b=c2xlQTsAtg7i9e29TODRuQYoprLR3Ru4bW0+xspl0nkzaYNFSWT3iaGfn8cyUydQLLGE0BCY7DLHX8rgGECCghf8DuVXJhA4CfAUWoaQJ2ZynUKwIshEeW/Xvt6ngFXS9q11tuW7wImr/zVgrRO+3D+smBBcpPnlVbFNMIHq/4OL3IuG34VchL27JTWTv6nKstgiGBUWq1uSAJrUMeldAu+KqgakH1FhCK9W6pMCOPMZthXkWwlnAd4MFf4/Hl+pd9hKqW5PESK5hZks2t5t24hXRiblA7D0uz6ZL3V7u0Jj5Fk/jvImhMh8RmEYU+J3/ilZ6KPWjbGhyh6FzkNr5g== 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=nAIiRvIi1lOxnG91KjnyRmAZG4cwJZ1EK/A8vbDAN40=; b=BgW7C4+FphXMINOIfGOLRvBt4uHROHZb0nUPzbKg+Tf9rX1F/SHbsxEw0roscECLXhIHf6cLz1mIsNABNdvAki8RdVJE6vClLI7hKjoZ7roTr/OCUriOrZI4oEZu0eV7U2rd7AycmTy+W/Pg2Imq0H3wVBAtTxCuXhRdDSY8eCC+uyxT57D0QtVrWFORDFcuOW0zyqyNcg3zGMYbPTySDU0pA0N3+/FTtrBJUpQZKVGJ5ftu5sMnZQf7FRP9W/3hTu5IsHCsKX4tlWSWw1b+AHFIRywf+v182wA3GDaF+xK/h6qGESxizQgxUbGSd8FucQp5TdIX0nuKXDyLBHGaTg== 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 TYUPR06MB5873.apcprd06.prod.outlook.com (2603:1096:400:345::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Fri, 23 Aug 2024 10:20:04 +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.7875.023; Fri, 23 Aug 2024 10:20:04 +0000 From: Liao Yuanhong To: vkoul@kernel.org Cc: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Liao Yuanhong Subject: [PATCH 6/6] dma:uniphier-mdmac:Use devm_clk_get_enabled() helpers Date: Fri, 23 Aug 2024 18:19:33 +0800 Message-Id: <20240823101933.9517-7-liaoyuanhong@vivo.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823101933.9517-1-liaoyuanhong@vivo.com> References: <20240823101933.9517-1-liaoyuanhong@vivo.com> X-ClientProxiedBy: TYAPR01CA0024.jpnprd01.prod.outlook.com (2603:1096:404::36) To SEZPR06MB5576.apcprd06.prod.outlook.com (2603:1096:101:c9::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5576:EE_|TYUPR06MB5873:EE_ X-MS-Office365-Filtering-Correlation-Id: 07dd6941-805c-4a5d-ba8d-08dcc35d2796 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: uF6iNjdvX3qkVom5zpfZoQdPPjaAWCdQlusT7UNquvme0b/AiYaMfq1TIlDBjgZkEVwDQsP7OwYKJuaAUo38VH2vsfKh8bH11B2tlEp8h5BEilD5zvSQNJQdKA4SSvYISH0K8Z/3xkZLyVx8/EsDnsc8w/9bZBePwXVeaSd9TFSWYjdAOp6TwOAltTLFPC+dIPdxlP/XVh2g7bGRABojaRgGR20yI951pfbGxdJNby6eiAJnYrb9FN0hKFVroCRJzlU7tPcUQACk00yWW7patQ3V8gdG6iiHKXJJpsEEUwbPR9echqlHRW03dEDukE1XXt7JS0UQWSkBnk01+DN0kK6/5CIyHfHXl6YqlVVuZcNUnbOql6HAuZMkgmyqlNhj5QT9uHme3HR9S7dqdcwlJMRn41JrQgKBMGBS2Be0+wicRtZikoj04nMp8e+ub91xKJexNqypnEtChby/QeIGCJhdlSCHyQLU9f8oRSvl18mGpjKms3H+yrT05G5rfu578Rzr2KlMiHz0ypOU511YYDQhPE8u4WmTLZvGUX0NTJJ1hWxM//zmXxfSUH1FBS1UZh2meJbO38a6IKmX6smLbpjaJ06KMqnTJ29YXU0B1UiCAqLZq0YGnLl+Xbe7QD7BJ8g98RictrjpPWsUvshePfVCMn9HCzewIZvvflNcd4rnH3oPyureU4COv3QEbvZAo4dfk/sxmIkVob23rkhfRW8m2S13MNDevGprY2CLv55lES3z49rSwxRPmYbndpLtzGcUMZ2tvzBcU5Iw6uCQ3QZ5SbnSuUnH9koqGZIEtm/LBJziagR5uFx12MSgRyquPD/Q041DTseAq1rOgcHy9KNeWRD50MsmVug1wg1Y8Y32eSttVt+nqPLkVH1ckV6b/6wkHE8prWdkJzn6MpXwY7VH27r40VL73HeMxlsOHo0VFySm74ZkeidYMPyEG7KBX2OOGG5al7Ni7LYjuN3rFnEtTZnPYon/SCVkCrkVeN5a0b9ET4o1rWj4QXeliLXfjYfADgVEYvmCi4Vx6JeoM2SGmu+eoO5KMYfPZ9CV5xvYOclCnEZxVsfO2XQdPly28rO1uYAT+iNaE81lFI1q8ZoruOV1Lfs1oXkpDpQ36X5Xb+Ob2rfMMTEp+Yj+tROA/7XhF+oC898urh1JioAO4MLSrirkqPLqlahndJdHXb/wNy/2mO2VQAsZUTI/c25XXEz0AggsBC/61tcI58CzDCTimUtZZyBCfoeN+RSd0JTuaOwyWe48/+XFJ3t8NJpxKwhnyBBlPt13TASlZSkhp/vOVafonW9cShOP758B4S9519iNe+EEK2OHFqaMTwejawi8+Jr037bxwOxOIJwnvHKQRjeYanFUmEgnKA5TnWu3H3bqeMc906mSGSsfb47o7vSckcgwlKRmOjZJseB/Rg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5576.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QSXd/SvfOAZc527PlfUYXrHxBNO2M6Fw50DL6ANKjK9hJqpcwAMWSTN4d6QW1RtXOtVsZgYtDoi9zuiiR0qaI62flrMnuZmnPgVttCApUsslwAcNN0RyCAhruvG0C32zMum/plUqX3BrYsxB6Ifw74OYdItz/tJO/QixqlhaLYroqfIU++VqS0uZ9PX9BYoMzdMH25saoNMxpmskJs8Z5RERWRxi5bxstNJKWXcekrDwjWicAyR5vs4gRAI1+rfBhMYKcIFp15u0Ntx4uY1kYo45WHRJXNSM1AEertq6QgAXz5s5DwB0nCJ8PlMj1bptm7KK3QGqevjmuFVIarxt9J9gevN3D23hwoUkImmQkTkIiwgmOzrkWD/vKJIw3WbZCSfXQmvZIuBnrRye36yOb15ife44nexiWkSQ1uVhYmksJi/G/yJ79kQ7w5VdY+n57J3P26X3rjFMl0SM/Jw3P6WtfEAlnZ9lNMVZPUXD4NR+N9Hc9WfFM/VGAvOD5RFJoT/JWe2LsHFHZKQ2DPISNZbi8m88T4e5xmaJSWfLFfpX+hAbMiiHXB12j2bRtD6LG57k5bK+wRv4Iy0Bex41+VLtE/Syqyoc2m3ztsQwtCRTwxriU1PXIXS7ks/yui8V7J7PL1eBiW/Vqm0s7Fp8E+sbhVhfEmhEUdHO3DSSYNq1Bmn6ZACXfY/zOaLW4WDRcUH7VhV19/fFMWom3ibiiVsq/4b6D6aoON/4BUUjhuR5iHJYl0ZkwpgSjANQjtg6ihf6AhiOSXqN8TOJeyj1nq1U6TSyicm3G9atD9EAE6dHxWpC/AVLoiBgIRireCTfV3wROs+yZDO1NlK94I9udDtOz0L8BefV0udL5vPo4mK43/CMOpTifyHmdODtNRWjSIh2uofyjYQUvlXGVWNp/zyDkaJZJSuCg1v9sI1B4lY4o2GqlNXtfA/n7XIU4EM6HJQGu9z4lAJTIwS+wXhehjeoz4eCC1Ptg6DhHxStpDEW+U6GPJlLWut1TgAp7GDlrhO+wOzUwhYuvYNHoXIIrWf+sn18UL/TDq62pnDOfiQJfASzRmBrl3OxPoYzbfDuQynA2ZWbr7QeLWsrglTHL3d7+oqlaex5BRp1zH1e1aNtuzCNtF1HsIZi2DjfMLeUTSaMZ19TXm8V1YwyhJPheb15/yaUVwaof/3Q/Cfs7nlhBavAIkWEomiTRB8M/3Nqxac55knF4fjyJ2mxmTW0kUn7NiOATz5nNuYFwpdCp1CL0pN9n91Ws04zhInlLfVvF2asxj8l3/f8cu4zS2o5poh0/OxYqNZ4AjAz/TAh+uzbYWPrP+eJwZXvELqeu77NNRcl+o5owhY8BSHgi4t1k+eZ4bmCRU2w2X08i0XYwVTaVuLENTuveVjXR5dZSZQMO7rdeno3rCawEz2Oq4FaWmmKoYFjMSSqsoEZn5t6qxJDxv5t96l1RsRrPlACJmpMeowLpPn+SSpiRLpZxvhyiuyR6dYCBqLpLUxpkhfJrE7WJiLadQBODEsZOpjwmB2YUK/+4TMTGeVo/xPoFFLkZExorrS5OmogAlk6MOZ3gp8riX1TA66dWgiXxkXe/g7K X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07dd6941-805c-4a5d-ba8d-08dcc35d2796 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5576.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 10:20:04.5187 (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: 6ezNzFy/r+Mb7tnI2iGa/wNVECQY45slT6XNImwYsxCbi+rtSgQI8Je9xjgZa+8rd5SA6DfHdvgUodYUAKzLyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB5873 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_032010_780503_0530A2F6 X-CRM114-Status: GOOD ( 13.52 ) 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 uniphier-mdmac. Signed-off-by: Liao Yuanhong Reviewed-by: Jonathan Cameron --- drivers/dma/uniphier-mdmac.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/dma/uniphier-mdmac.c b/drivers/dma/uniphier-mdmac.c index ad7125f6e2ca..6b3570440b70 100644 --- a/drivers/dma/uniphier-mdmac.c +++ b/drivers/dma/uniphier-mdmac.c @@ -66,7 +66,6 @@ struct uniphier_mdmac_chan { struct uniphier_mdmac_device { struct dma_device ddev; - struct clk *clk; void __iomem *reg_base; struct uniphier_mdmac_chan channels[]; }; @@ -383,6 +382,7 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) struct uniphier_mdmac_device *mdev; struct dma_device *ddev; int nr_chans, ret, i; + struct clk *clk; nr_chans = platform_irq_count(pdev); if (nr_chans < 0) @@ -401,16 +401,12 @@ static int uniphier_mdmac_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_PRIVATE, ddev->cap_mask); @@ -429,12 +425,12 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) for (i = 0; i < nr_chans; i++) { ret = uniphier_mdmac_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, of_dma_xlate_by_chan_id, ddev); @@ -447,9 +443,6 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) unregister_dmac: dma_async_device_unregister(ddev); -disable_clk: - clk_disable_unprepare(mdev->clk); - return ret; } @@ -482,7 +475,6 @@ static void uniphier_mdmac_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 uniphier_mdmac_match[] = {