From patchwork Fri Aug 30 09:41:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13784832 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 72D07CA0EFD for ; Fri, 30 Aug 2024 09:45:26 +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=qJO58SaRiGU8Lu4OUByvSdCxzD 65x8cM0m1jJyu5iVP2oYphU3QA24SYCX1Ufxot8nK8ZaigUvV6S3fKaK8hhrOgU3vP3m7TEPuOxOW H+cshBJ2G8ZY+rmDqKe8xz5kNCRrx41a3p0AyPJhxTBgcEYXosSGGCckAcnTcgNt/ILLHSzHAfpH3 u+MM6UQ9duTPJqpE/XvbQBKOX2FW+J8DNOOy69VtElbrrTxjnLljIyRqtK3aCtaq4vblDqyD9wpy3 fA+DeWeBy2rjREzPTc8XOpnJtKsjwtqDevn1/w9sTMGhhyAqxK1g0ri/RmWR4tJI7SLRls8VkAZxE bMYPSsbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjyBv-00000005cce-12jf; Fri, 30 Aug 2024 09:45:15 +0000 Received: from mail-psaapc01on2061c.outbound.protection.outlook.com ([2a01:111:f400:feae::61c] helo=APC01-PSA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjy8a-00000005bkn-1HjG for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 09:41:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OD0HRwYPDa4EzguXEqEjtNmzCkDaJK4kXfcZDo6ryj9t1xlHhRT52D1nh1LfSyaTPoGMck2ExWJD8xGPxUVcrLgWa3A8dvm8E1iI6tGLZkOK4aAkBCgWq9lJTUlT4/TheMr60adWvrAtaLm+i7dv7a+MgLmi0gDUM1igVRVHZuLAX0CVFgpkoCxtxzjnpg1XP0g1B/+hIGnn8IZxId3qw4aoSzZwnllzZH9L9J5oaBrwZpPDU7JPKowQbvTuWOFhvC8+caC26abFc5sD23YpHveBwzth6z3CUkGteA0loa9fjH1acdiu1EHhkylVk/vh7OK+kCTk0ouFn+uikbW6gQ== 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=vAyN7CDlUK+/x0damW0hkpoLYU5sxnkmk2NPUTRKbog3pKo2hx28fhixrqdO7ANJP/l9RfgeMr1nmnrVJzcavMoeN06k6iKPNhgaTuVBh1RvXjjLgbTRAbOm6Ehqt7K7h5pWibUST7JKldTaZJXfCXIhlXHic+anPZ9ecEI7cZDDsW/vlCRdyxt8EtPTtRwShvw8Yw/wz5d6ppOyUkHIIEj5N06G+bTHDXwbmUgtj47u9fqarmj+uEwnieGS0MO0fkv+Ds34/NUDZs6y7dSKxi62UobEn/RHIm7TbaOtoPthk7X3Xd7VKtmNnuP344w6AOqrO1ZJTZIKSmcK0nRiNg== 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=pM5Q+5OfSDpkiNeRasec7Tdl26B0qGI075GhVEh06LsFXnHOupTL1XXt0WOJS1vFwlaLgRG7S7kGSGFZEBlzlJAP1vpitls0cBe9JSvPLLyEnM1jqL+aHfSwZvcST9w5LfexS1x+e9U+EDxeo0Z1uSap7/fs1E9tcC/ABTU7evQdxZTyKbFvuVj6c4kUabAuR14OduOT0SjExKoj6nOCFIHlYWTaDJquXRPYcplEB0h8E6iqnUBHLxDDzQ9zmPEqLNgrDoNv2o9rrSPTttrqiH6f5UtMA3VsT+K96pD4I3Z0QGmUl0Zl2IsDwzxkoE69TPyiJsN4QOx071A+rIMdBw== 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:39 +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:39 +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 3/7] dmaengine:dma-jz4780:Use devm_clk_get_enabled() helpers Date: Fri, 30 Aug 2024 17:41:14 +0800 Message-Id: <20240830094118.15458-4-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_|TYZPR06MB5203:EE_ X-MS-Office365-Filtering-Correlation-Id: 26d5a50e-d530-44e9-93bd-08dcc8d7f27c 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: kmbDlkjnze4i4scuK5McV3Zh/AR0O45hr3HxGVaIKNpQn8vZ73khYI65TMeoyzUxDYpOimTUIoMgX9/FCvEl1XOgka9zthE8q/euZlH8ZanK2LPu1Am6wT1Wgh2Iafn/AODJ/Pbd+ul+HhdUfkSup4xZRu8Q5XVzNaMMIh2ptsT3XP9aAumJ1wfIU5lvVhy3e93FtDyVrBn+mv8FUa5kmsfFnVq/0ikqrfpZG0Wqjg0n83tAkKsLPw/y5Pr4I+lLU9IfUxXjHoXWhzijXmvSG69umlh36HeuptX+cXmbLz84qI26K20Vb4omW85ydwnMPMgdRapTMBs7NcqAy0F8654JKfuMsKHDx1FFGn4TBBfhixhTNlhnBOWO0CWzzeyafcziALIfUX8o150w/uz5OWi+qqp1s4VOpOXK0BC+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PM;H:SEZPR06MB5576.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: 5DBK/pjBI6M5XI7/HAkUn9Qj1QVTelcPj3iTbHZfBqiWddrLxRDKfbn6KpaKPg2U3LUMwveqT9J/0k8/k30bOAhS5opM+syfpoDeq0pqQxelHfRG8+u4UaN8nmJs4AMR2RrY6aLzTz45dshRxczGhgiDLSN00KK8I3RJIb+4K7Ec4oJRiFKBkJolGQ3KakJD4/y2xtvLD4H1tcnzT0cnLzn2O6n/nwAMNht5+fglZjk95nRpRkXrR95Z77pPpma8WO/+hg2QdvcmcVC051idtTpqNpNlLuQknhWKjBzEk9L0idI/7szdrGdldeEcMxC4N+2h9XhwVSw/i0ZlINw+qtXKDWqgkuMAmfD1A1ZwcZ0LnTX3olVtcgi2u2Xn0dZfS8KjjtrO6FBOX6SbnDIn8iUB1IhV/XPDjYX2hCKwinMANdaEp7qcQa/QyjP/SgWiqu39uVs1m9QLcfBJK13engl0AZ5z3gwLzhRW6qHODTCZNu/Bljag+RNtzjnmrWARRc1GRKvEoDJ6H2V9+ll85lM1DtfKiVq1JXjBgbIzt+/UNgguG0a7sajW05pEgtM6UYHZLboJl9IPplzm5slW/SJ3LVAxXvj22tcG64TgpJCu2wt+CzeqJ9gnbW3JWLj9nvKqKh2Xc9/38qIk3gFfCGXyHChY0BRnqjzqMhC9SMPZbbSJ6TxoaxBwha95heafuN6pj242Y0Aj3fMcSAk+GrBd1y8GGq2+IKcYKes0mtieeJyWakM9wMy/CDpVg6ADQT5aN4rQviP8S60hNXCyFKURL7jPLW8tScG53ijI1ueXf/gj0aZJ3FhK8DhhL2Y1wo59igiNF0kQJx47+OC+XHI7CtBQ95/nMjZXrb+qmPJsXI68Wpt4S3d32OjXLYOwhZD+F7j6wJdJ5iU0D6rdSr7jeEDm4c7wzlD7zQbem8m8moZ7wKaeRyRvsJEkq1Bz87kpVHykkhmJFhd/EJzo76XkytbXPhd+1n35TP1N+rtYuqT/87xnmAUTGiuUFvodXo4nKXWu3wXsJQhYyDzWoMr0wCfALGo1QJWzqgL+c5wFUmlU00T/vvCK8de2DM85B4pX+p4oOaOVVI1xT3aIiC3DcoouV6QJ2BG656LFgaoiP23FFe/MLh9oxwVtHoFXVF8kyWooG2EBnUIgonuaX47MS56M/y60h1Y4kNnJP37RFr4RDNSuYpfSrEVJxvpv+t9HND2YILmvuMen5vQpMcd3mPrdhfOb3b7thaIrWceG+UXQZ6JEQ9Fqqbn59NUDDE7Gr0gHEiEDxshTMacpGco0/VjqSmzNWhtMvCTVbswk99VXcR4tG1oOxAiLb8fgmfCV0nltHbx5upyBzatZ9YfH82j8Wjl0iM0QG47K5ZftcN/vdjunk5I7NJv2EHEfFK7q39ndJrnRpOGTYvypym7ZfsNKKVx/ZYqaEMmqP3ZbI0+dZ15HWvITbYY3jR+CX2IB2zS76BjuzJGmI6UpER5kFx0eSgD9tGNmuLqzz7MaqDM7MsEVGt51lgOx9QwdfjIPo7kbduAvOWa2WX0qpKYWSmgx0wWxnP9koOUMMHPnwm9RLsP0j3io7Fx89+jg X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26d5a50e-d530-44e9-93bd-08dcc8d7f27c 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:39.3339 (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: 7TuISufff5lBeq9ZVZIkTuHqmS38Q7RPgIP0CZ8Gcv+gL/ZzbeD8qqI6qOqEufhDkGOP8EBRGe0IQ7NTeBLTuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5203 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_024148_371778_9F41E142 X-CRM114-Status: GOOD ( 14.94 ) 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++)