From patchwork Fri Aug 23 10:19:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13774931 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 6179CC52D7C for ; Fri, 23 Aug 2024 10:27:10 +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=jSflPk0BFm/B9lDS+zKq7lNbv3OAyQZkdwzDG4lbNz8=; b=xdGveTgf1nUTVlDndRGQxVzUi0 Y0PmtXiJ4yRs0AB40No+u+6SihELp9QhYdFktd5sNBQWm+FyGAO70xNWsQYxDwyCaudg+S7+HXweS g+q30Vu1IwiSm7WeH3BGN7jshYA37zdntcUGNFlgWpH9REWbZAOEdnBcqOi6nyZY88JkAKlI1Wbk/ cVuJ+pfuefrQKNVYZ1OCKM1YecbZR+IMyU03RoOg36t+LZrKKk00YPImw6M2Lzg4EBZQUgq+rJMwR 8hINas0Nb+jby3I/D64rPbu1UNOaTKbHLX0nvutD2+BV01c1fFJV2zo8i9TXXb3y9wDxMqMIWTC7J Od4tR/Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shRVT-0000000GKc6-0DrO; Fri, 23 Aug 2024 10:26:59 +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 1shROk-0000000GJ3b-3I86 for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 10:20:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z2Ya68rCg0XEMFcmoZazRgq/olbe1KogU8RNduvk/ofgcz2C89D77LDF0VUgxzdR1L6l6mMH0h0q6N600UHochgdli618FxrCCNWHJdzbC7FoBMlVULo3QqEpESgOY1LK8n3EZCFkhXt/SC3uSu6oL1BW0n3mENk+VuUuTN44pmAYif9gQ7XJ5o7xMrI+0616bbuJHJlTBD0vgsKkH72VhyKoRzJYXUyio4Todt7+qVkVOzih35Lse09Wfh+M3dgrIcfDJpVQqKC4A6Wo36H2Gfjd0CLk7D0/7jBOwtIsDoHDsnWP9tt+i560yOG3RXjqBGoDmRY5/kQ7lU+bvox3A== 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=jSflPk0BFm/B9lDS+zKq7lNbv3OAyQZkdwzDG4lbNz8=; b=k6rT/FkweLNowznkg7SjjI8nRXH9J3+7OvHAaHkDcPGDSI3BWZ8dofkRGPKGhoBRvzlGAG+Lvf6vNxerdQqKd/CqGbL45N9AmN7ht1oa0SK1ys/zbdP/beXA4GyKNqjD2C9Rv9jI2IeBLiszeXBeNNDGr/cYfuZmuNdMst0RFusuuMTKLvXTYDoykh53yP1aEY1b/zD0cd6cnw4ZpHKpUPim8H7hwmClKj8L7v4LFQwVy32fgXhhfSeSatgd0QIPKAqzOW18Gauz2cJPYwv3Jfoug6OUsJSiqrvYP+1yvohNj08lz0QF2C39xdqSGn3BAwWhmQj/CfP0BYgAVryxhQ== 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=jSflPk0BFm/B9lDS+zKq7lNbv3OAyQZkdwzDG4lbNz8=; b=jM4h0sVPM+XP6le8dTrIMdC/EUednUhB9oRh/foCXsj10+QwHVD1z3JnI/U+QDxE31+B+GL1os1WFMVGJ0nRJuvfhn7o/zVAvZv8XlO5N45fQoGpKWv45LqCyeKdhMazPDTo4kZatrkWMtMzfe7sys43UrpalrbXG587L7UDg04vlg94v9n++n2fkVc/dB6b2ObZFVk9sBZVDuEefvSLq8ZiN1pBsG52nkrTPP0X1MDZDGIrHt3p0vH0v1OqEEKCY0qSHIDkT/uEC1m/+OP+eYfRMooFni4gS/D+d7JT4YX55JrpfHRFHKyF1LbKEevmmFQed1gFcPuQIWCyh21nFQ== 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:19:56 +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:19:56 +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 2/6] dma:dma-jz4780:Use devm_clk_get_enabled() helpers Date: Fri, 23 Aug 2024 18:19:29 +0800 Message-Id: <20240823101933.9517-3-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: 9cbcca87-57ac-4334-0632-08dcc35d2307 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: JvW9lSdXOP4ARRyIF8lwIEhyj1ZdRE9wq9rClDnJ9iKyc/WbaSFQESSuJU/b508lxtlvyAZRmr48SPpnMtAca6kxsRatb0TZ7FEQoyevFGtHmRrHKzTo/9uGsKADXqRtp8XE2V/hzjWgpej5htrSFMPji894hm101uI+12cjqhG5YjRIG3B9pN7Bu260HYjpC+tG/tgaYB+vyQhHCYHsLwq7CGOi/B4XOTKmf1tgyCD1rjDZFEY9O5UFICTRfZoFNL03zrEWx7EWkBR8xTIhofs9DAB38wMCEgGCZMY8zQl80xF/OhdnCAptjMsFxcPQNwrG4GQvLJZIywT68LGH7f9QIxUkhk8aC8DOG+JJEVuHT+U8+S08Cmu7gG972mTsEQWmnf6rtRXu5tNDwYigFC2XWw1uSEgjnAr6ZM343+eaEqu+mZvF7Vc6VSUjZtN/ybHcg3Sw4jx48NZiF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TR:;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: KfonzicP5ZaATNsYFL1Hxsr4IwiKDWMIf6Z5MZinRy3yPPf9u+qDqAQBMCaZXiJsRFWQsgHPT8OiSd4Xst86qX8zwuhcToCGtx2ReNMQ7XXT1tJZ6lhRmKB303M4IJU9qkYj9JXtUeAzDKM7HGhnD3znGmPAsrPPJJOk4lJEkBCxWKIuJ3TI4hmhiVwcsKgAIJAz8jN/wVXNrV6bbArJc03PEvyDp5YWbvwalYL6j8mg9eRycDIR7jJXkOerx+B/D5ZSjoovShVTkb+/uU5EJmCOPqMD0kL3AYpsIo2vFJ0SwuE/Ykiqul64hAxC21GFlsCI0xTBc6AMvZiQkrliQr8Vb2C8AsIILeA/hSVVHzDXtSqkKvwIWn2w6pBY4JQc9cNhENjyIKGF6zoWZUNU8gBDlBsvKxBdQ/+Em13Pjsjbpkleq1jlp2z+WcIhUML3dofTTl0qexnSNp9KD4FObG5WORTX8YUhY+03Got+lMVyZdlK8S/l28vKNxOGDPNXyRvhuBMYOAwrzoIOSQHbh5KfLgywg4QnqTQKeUtY66IZ27Atc0k8iKmOH39Df27rAvSgzsemEq2yvl4O1cyVO73ilkiVxgFfP7nz51zTAq7nuDFPcdWRc8Vcvei+VvZpmvb8QRS1NAsXbHSLgxym71LZjWsIudpEu3xZqg6pee/jPvmiggfWd5v5oPhzB1LPyux+IPRmoF5R1NukhJIRMMb9JRPjPUkpeaumH/s2ui2GKX4ovpgA5wJl65ih1YENfNC4VdBCzLSj8gGdjFkf6NMACTdF3ZtYxto4T2EhHkH1HsfCbUeklkSUD+yHdHIq9JgVvmj5sTlKDOckpoSU6K2Hxqbyr0nRC+TVNyv31fePl/pndO9y1s8y1+EpnO1N+VwFPFNT9pTW2XPIwN55yMl/yhkW740Gtus17Iis+QyoHFArGFeSX0TitskdQS1cnzRXBaCbXbVGZaaL5k1PMntnJqSdLwea2z8BwkreLPOGsoG0Ln2TiuUe+LKI3mEtx8p9ceO+4z0N5av/3qJ8rRqqgWk0kwR9ronOf4U2e2i7S4so3gCY/d/kAevseFFss3B+0eavfH9RRTwZW8xxr7ZOvqwnEXFEIBxj0uSAxK+XsUwR6MYh48o++Y9zJmRJO0bEuDLs7o5ItCoj0pwmMsJVN/7CdFUoYWWPXpAuTWeLWaoTvTYcJ/sCnaIW+JMFmgEbV8AY1yrlD6nxhXqColCecdPiIiA2qDHxP/1g1PHOn4+Ysb0J6dity76L6bR1RVQHvv2ylNJABNCB9GIz0tm1ywXgDJIE6/oMTmor6jvszm3uNW3vWRqqYgUb/1ORYYH4NF/TQy54VYBxy2eAvInld+K5pquXNb1FKsDmemgvB0DiwUYaRNkRGkMOu2mejClrar6XKcjCJ2t4/2fBgd7UubUkGKsv+OCoOYXklNtto2taQOt6pEKaIlKh/5s8/KvHLMwedytYuduuDpI3LVn7OfygxNmNfN8XsEWBSQ327q0W3HMFgwK3Vut5BXqt+oBvE0gc3bAwg7pxoOnO6L8DlQJ6ra+VXJreD13XlFJiXusqFFCrezdyOuYaFjba X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cbcca87-57ac-4334-0632-08dcc35d2307 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:19:56.8520 (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: SbnKWWlRzdWZYUZlSBBSVA+GaNN9XPKgDu5oMP3kNgm/elNVfYIBTyvdtHcpmHUEdmDIR6hDnNFc4UVc/o0N6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB5873 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_032002_868692_49FB1670 X-CRM114-Status: GOOD ( 14.37 ) 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 dma-jz4780. Signed-off-by: Liao Yuanhong --- drivers/dma/dma-jz4780.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index c9cfa341db51..151a85516419 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -149,7 +149,6 @@ struct jz4780_dma_dev { struct dma_device dma_device; void __iomem *chn_base; void __iomem *ctrl_base; - struct clk *clk; unsigned int irq; const struct jz4780_dma_soc_data *soc_data; @@ -857,6 +856,7 @@ static int jz4780_dma_probe(struct platform_device *pdev) struct dma_device *dd; struct resource *res; int i, ret; + struct clk *clk; if (!dev->of_node) { dev_err(dev, "This driver must be probed from devicetree\n"); @@ -896,15 +896,13 @@ static int jz4780_dma_probe(struct platform_device *pdev) return -EINVAL; } - jzdma->clk = devm_clk_get(dev, NULL); - if (IS_ERR(jzdma->clk)) { + clk = devm_clk_get_enabled(dev, NULL); + if (IS_ERR(clk)) { dev_err(dev, "failed to get clock\n"); - ret = PTR_ERR(jzdma->clk); + ret = PTR_ERR(clk); return ret; } - clk_prepare_enable(jzdma->clk); - /* Property is optional, if it doesn't exist the value will remain 0. */ of_property_read_u32_index(dev->of_node, "ingenic,reserved-channels", 0, &jzdma->chan_reserved); @@ -972,7 +970,7 @@ static int jz4780_dma_probe(struct platform_device *pdev) ret = platform_get_irq(pdev, 0); if (ret < 0) - goto err_disable_clk; + return ret; jzdma->irq = ret; @@ -980,7 +978,7 @@ static int jz4780_dma_probe(struct platform_device *pdev) jzdma); if (ret) { dev_err(dev, "failed to request IRQ %u!\n", jzdma->irq); - goto err_disable_clk; + return ret; } ret = dmaenginem_async_device_register(dd); @@ -1002,9 +1000,6 @@ static int jz4780_dma_probe(struct platform_device *pdev) err_free_irq: free_irq(jzdma->irq, jzdma); - -err_disable_clk: - clk_disable_unprepare(jzdma->clk); return ret; } @@ -1015,7 +1010,6 @@ static void jz4780_dma_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); - clk_disable_unprepare(jzdma->clk); free_irq(jzdma->irq, jzdma); for (i = 0; i < jzdma->soc_data->nb_channels; i++)