From patchwork Fri Aug 23 10:19:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13774942 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 EA63FC531DC for ; Fri, 23 Aug 2024 10:30:56 +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=8seUex0RD2SKfh+Sl7egdxEBbYQR2pQwRBCpA5Wan8M=; b=432ODGBCKNiDyOsSNCxyy6TAF9 gLiuBKeHF1PqFe1G5KzpBL3ZthJ6rdkK3jrlin/ey9P/o55JW2lpo9ubyGOJPmINJnBuQ7MmzNRdw eKBm+Xdzf1RSqciJYW2H1kx+eLUyfEFA0buaWTn8/1EvdkW7z+J4v/XPA1IDFx7gSxBYoP1SQtIGb 22hpGmVYjZCVCXEzyTU+l5N2DIYZC1OlRuPjfR0E3ldPNoa1bIfND4KYGM5JAFpRn6IAaTDZ2DTzJ +kER+RwfEI2G6CmovszEsLcfe0A5H4+AK+ouWOB/QZsmU8AK2X3Y1pu+pIkGyumtwBVi1W3ESQ6IG FknPzn3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shRZ6-0000000GLfR-2Yd9; Fri, 23 Aug 2024 10:30:44 +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 1shROi-0000000GJ3b-3rhS for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 10:20:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ALPxwe5alUos9HrzzTxk6cKemH4hh+jOUz60lILPO2IxCPZ5PKBOY1ImEiYz4eQtF04AQ6ti23K68khG1jr+nlD37PGu0cFoQaoikkxNdzWStoFgYigxBnCmCnnEXghQIDNlGQtm8fDVVJ7y72blLj+GktyHMoi2LhnmBx559oXHxJ4nm2Zrn/SzgZQUGkLcMIhZ4pBp8EHXzkBgXE26C0fzzA7Imm1l8lVn2shgcBR6rfQDedljEpPKAXCUymkEXtGBOy69QLcckz4Z82V8BZSSmiBhwgYynCubB8gtENmIDGZmn72Y3zVRqgh7WSk5V8zZFVvzX7OTu+wfAdNb4Q== 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=8seUex0RD2SKfh+Sl7egdxEBbYQR2pQwRBCpA5Wan8M=; b=piQSwUTxCpUokIvXrFq0EkDaKMQCbqtijbAqCpa5SQ7Ru6R+/63YZWg9SK2pEjUOdY3bjEeR2On4aURlONWqx/+4siMdsEgZW7lual8R1Bzk7+6C/fjTL2ie36Csd2FPROkdT2TFqin4FEKX1CDleGwVVh/1Mv3vbkWHOCXkZ643pWZaw/FYudvz/0mx6NYUq0ZmyLIAaRRFt6E0MdVe68WVSuecEAPggvjbaterJKdxu1KbrlUu4/dV9jfqkJGcNvHAHigeixrpUE5xqVpUryE2tIkcLE9fdVs65eGYgua2u0p3tfKfg/Llo77Hg+AlFjnQFA40YNOEOFKVG1LVSw== 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=8seUex0RD2SKfh+Sl7egdxEBbYQR2pQwRBCpA5Wan8M=; b=RqISrgSLJ0AHBdBPMDOVD/T48SB5KbcQXrVfU3ohrPrw9xJ+omBOzsWzMDX9JtlslUOX6/3trJL+XcqPSOjX4qbwvqH1vQlag8WOKAXB8B1bO5ChNPjhiguJjgsGM9Pb3Y/7gdyf4Xnuo1/B3lSFauGuHn/LU8KOK4MUR4o17zebfrumrdIc477E1hFiNsGZEAuRnhF3R7PyJn6dbQniSguzVHKT2Z4CofhmflpwKiXim0tf0KC1VCSxs3tZnrhDmvrq59kCpALjuw5kWRoS9x5SI3GvPT6/yBL5f5AUVSGmLtuaglNdRVF+g5oBoda9xLRYn0aMJNuroXZ+HP/pzA== 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:54 +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:54 +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 1/6] dma:at_hdmac:Use devm_clk_get_enabled() helpers Date: Fri, 23 Aug 2024 18:19:28 +0800 Message-Id: <20240823101933.9517-2-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: d74f1b3e-8cd4-459c-5664-08dcc35d21b6 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: Yz+tImNTnCUN59sp91Njvdxj7XJ8vVHEwtdLjivi3zHu+CPbLRKQtjeMugCA3Xis4Jt5vXitse013u79bN7F7k9XhNCkx+EzTmF7yhm888HPf8bit2BqkLGHHEAddVsZNsK/gSDmz0D4zQzn8m67qXP6wAFENLGmDjD+X4ySWhOeIw2745EG2cNHJ8ddU3oEk937Bo7fc0pi7wvhRUC10CCTgHLX6ON6D+4iijvHipQOXSoIsK6ATxcAyxripfzMxYN24IUoNCnxG+20gNdHND8UVHAM7lVj73ajBTY5DVRU1WBINkug3dj4mBdNJRhFbV/+IpB0yoNjVovtTCLl3EwmuO7df7NsvWrL49316fyHEJ0Z6f6LepoMeXjgQAvdnrwaMytIxuPYkHUDf5+YOiRGjalcay+RU0/pCK+etxEru8TyHYTCnrigvnmum2Lh0+f/ORDsL3zKS675EPVEi2Uku91t1xllcqgrGMSQS4vExCgsrKoyzZZmxjb57BINuHz8fuK+6jJatmzRkKHMs8doXcYnxJebQmGncbrakzQrMITDLUOTgPNI6VpbchOXc1rKBnwYRz1hQo00D/aN1MeDBaxWjEOJw2XPFUSG4qMBLVn03kXM0YuUHqOlIozKnQZLodsDP0wiGXm2Hf2/8+JGxL6tozhM1wdCas5tgTnjnzFSGjzCUp/y5HYbTUvv42BOukvOX6FbmZYJ/CThAzKBIs0gQHdNE8J48Is3l58foBmr7jBZDBrzhjCeuM2Six5RwUqQKDBAXx+f5yMZxqYhO8tU5wMoV+dEsb8cow7berIr4t3h/Wrag8vATO2TOm6aNarVDGGzEck8YmPKUfGgw7tSm6blXGof66EhM0d+GaVSE/SgBDXtmiVzCT/ev9i/by7qfgw9Vi4f5vlAiU+x1K2HhCkL/bLCprBYbPsfMfgy/P8yq0FLUQtHuVYxjKHjM42wFscbdboaBBZ42d5XJaFKhZtjPOV1cqzgFSA61SUpZW4sMoChEJJUn9fXOwNTRxZAUQa2q0vYBpkum1XOlLQEv3Ye56P2r97OCU2wPhkU5rEBbkEK+RRmPFncAelw6ReCHP9Jccrpym2y3pf54t0AqT9Udy20rQTtCFP7VirsLwj8N1TfYRJi9HGHUwWjN2lTTmTlk+uu1a9rpvC7y8zcn6nPSICmPmb7ms91iOHrio1z4L9MhBRWOv7Z0VIULGm1iJE7cCZXgYmULHjuwl3CCih6PruKTLKkl3dXl9grEtGQ2bWjJkdFAaVrcjSc4p6fnwRQmay3Ak0EFAZpsdOT9perpm+icCDSPvujevW1CEznlQCgDgEh5XwtkbwElNpv91vbvxEb//HmIwIG5gVsoFY8EY4/Jx4fJIcdQPNn7pyXlWob3fvO0XUNPr8fkC45YZ8Uu2Y9hzdrxw== 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: AOzcYHh3GUqjrb1UMRhiao7aJ9Txm2zHqswmERRjbfAnmuiXpdFf+OTT+JXGZAs7R2exr27cUJE9CZzyZXxrXWYcn2Tuj/+q1VSyZbHeVFsTenrmS4wqFHdnf0prYgw+xJdfYx1l9oGfdJLTmLUzqgou2RJRcgc7qFTnOqdlyRdcDHlkRe+CzMCHqhODKEcNxlJDgAEA/ApZZsK+zi5q/RppTAlfRRZa0zb/nH1CwcbZPnGmW/PqNVkjtK64NM5rtZzX3WlyJy0accX52Q3oJsmdAM8My0cQBWwGsP8OVSDXELDHwNffgUtMZAiS0tPhu90YLHsf/gTZoVrUjMw8yevnFbryxr7cC7vqkkDNZ4SwxhUyc8R7llrRJlbGAWTnrN4d8ZX0PgTTZ0178odmrXXlOoagft6QIyZt/iCwz9Jvwh0jfvqjHo9e4sHnV6VvVDDfZKW0eJZSajorA3xetkCVjMTNk7Lpp4OrxcquVxalZGkuugQ4PgpvdaqPKrQFqow4DBhYosH/IC5LYVc0oO4DOBmnG1KbT7JNNaSyDomgrioilufUtnmmt8fNoLF1hhpMC3k55OakE1JUykm7DzjUwvWH8VX6bhvM9BCb15SgQlF17/GXmgJMBWs7AzPihU5LE0aK6RPRiWD9eds+bNjQRh8FanLJasuqez2VkKvDd2K3zLgEU7bNp3vOklXgLGZIXRB3waYygNfC5D1X/48rm5awCtKuAezXd77bcvdsT9u6MLBSkQZQcLOv47y0zyEIhD8YSdAX0ODwaucKRs57g9aWRB7ggDk+qhW/FZa/SIgFq5j6xQvLn1+UwNzxtB1tnAqEdefefL2RuNw5Ku3FVg+NL1z2Y5P5rrhgKSePDG5zo+zZLkmFiNr0G92+Ll507FFi/xGpk/1ksJYW5yc8NvQILDPmBEYdClhPXzx8iXtD7U3OKX3fguRPC5qdyQBW3JnUQ4RrEmH1doDMI7sZ/b1HbHR/fCv/Nb7RJMeRWFJ0UxWhX5UQTgfjxoT3OmM3SRa/t4k/xPjgInml9s/gIf090yh/4vYS3G4RySoqVbi/i/pYnzr6p64IiUk+XRF9/YVuzArsGFNwanAW/NRTwohSTGRvvpd3wBg0juxTBEH4YnJ267k6SoX46MBZRjyalxZVIVZ3w/rh9s1NN+51lF+nDySfTGrgWpp8FoBcWKN4i5q8TZqrFpG2GISFW+O6oSkm8feivf99HVlXNmE4VguepEXPzGu1KXcyjE2J9ygVqNB3TAZRisRMMEFARqaWJVRGt2rcRL9RYd3RmimEEQKDeF9lUE79aubYleAVOvO0IhVr7DL4lP4xGU3HD/pJncHCidKrizbUUeSdSLz7wMOG4grALDJQ4LrMdgSEtqZkNT0/qdSnwFL7xI+OXe4RfTTf/KyvXtOGWNAfgrZQIlBmmKAfPoUAJ8M+0HQVm5YBQztT4F9MG09zoFscuMdZnRblqQY6Ox+c6ppLAG/zkFaJPZKpPzaYw7AOwIBAuPnd99Or38uI/v/xze3xE/tFKOJBI0f0sFv+Ik9EV5oBMyVEw0wfR6KD0phJ2feAVfCn5XmVWmeYB+uyTsLl X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d74f1b3e-8cd4-459c-5664-08dcc35d21b6 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:54.6476 (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: oXX0v+Z/vFE7jupz8DGWbrjMb/sFV5hZSi65DmCxry9KtNB6UtNM9KZCloivd7bSQrhAvYFGVl0A/4ZVzJzrYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB5873 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_032000_991173_959B48EB X-CRM114-Status: GOOD ( 12.91 ) 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 at_hdmac. Signed-off-by: Liao Yuanhong --- drivers/dma/at_hdmac.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 40052d1bd0b5..b1e10541cb12 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -337,7 +337,6 @@ static inline u8 convert_buswidth(enum dma_slave_buswidth addr_width) * struct at_dma - internal representation of an Atmel HDMA Controller * @dma_device: dmaengine dma_device object members * @regs: memory mapped register base - * @clk: dma controller clock * @save_imr: interrupt mask register that is saved on suspend/resume cycle * @all_chan_mask: all channels availlable in a mask * @lli_pool: hw lli table @@ -347,7 +346,6 @@ static inline u8 convert_buswidth(enum dma_slave_buswidth addr_width) struct at_dma { struct dma_device dma_device; void __iomem *regs; - struct clk *clk; u32 save_imr; u8 all_chan_mask; @@ -1942,6 +1940,7 @@ static int __init at_dma_probe(struct platform_device *pdev) int err; int i; const struct at_dma_platform_data *plat_dat; + struct clk *clk; /* setup platform data for each SoC */ dma_cap_set(DMA_MEMCPY, at91sam9rl_config.cap_mask); @@ -1975,20 +1974,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"); - if (IS_ERR(atdma->clk)) - return PTR_ERR(atdma->clk); - - err = clk_prepare_enable(atdma->clk); - if (err) - return err; + clk = devm_clk_get_enabled(&pdev->dev, "dma_clk"); + if (IS_ERR(clk)) + return PTR_ERR(clk); /* 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 +2100,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,8 +2123,6 @@ 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) @@ -2139,7 +2130,6 @@ 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 +2184,6 @@ static int at_dma_suspend_noirq(struct device *dev) /* disable DMA controller */ at_dma_off(atdma); - clk_disable_unprepare(atdma->clk); return 0; } @@ -2223,7 +2212,6 @@ static int at_dma_resume_noirq(struct device *dev) struct dma_chan *chan, *_chan; /* bring back DMA controller */ - clk_prepare_enable(atdma->clk); dma_writel(atdma, EN, AT_DMA_ENABLE); /* clear any pending interrupt */ 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/ybHcg3Sw4jx48NZiFPS6DHIjRWjVPIfv7aUwbhSYfDJuD3DFAP8YKWaIN8+e0I2tEf9qDBjJvuJrtFSPhsWk09XsOa0y6qkgqFQnwDl/SOwu3Y0N2oYhC0VrxvdHOdSGQz6kr1pj4nfW/tuW6AOH9nTZtMPtiHAZJSjNPwXBOXyaL4kajxfPq2qOCMDTCfA5obLyQLMZ0yQfoMSaMJEUbQoRDvxtj2Y/+zYT5tS2Ct8emYELMPtuQIdEY5rsN1KzgaosqUgp5cv75DyqjhfFNSPUS3n7YXicJlzYhG3rV00pWL8xhYHqI7Lq4bN1BJxKRX760R0kwP3pyo925+6zNDTFTwOUIyt/8QaS2SJSnGMjLiKxQRxlINK+uNKkAhmau9Xye/9N2/uj+bgbH2K81/QHBCbHPpA6IXsG0Ycf+HfgpuRpwNiTNXPPkFqd5EJzGFedJ0wrieLJuOOnmacPF/tMHq5ohrrMIEne+GK2yHIU64N4+h49GO7kPuf1C9GW2yhZLkaSxvWxxSHQRFNtY1zyHlwTLAWTuAG8kwvDHpivriPjPCiPJSfmxgNDk9AJN97S274KYtD7ZX+hc/zyUAub3P2UxmNntn8CCL0IlJsvDDmVhnDpirvBii9dsvKX9UONTXuGCxCGSsdjP5oaEhS2zH9TIqDgf+ItEdOaHm2O/wz8v4EJJZZR3QvjQ7hC5XtasAKHN+u+P4aDP0E0aYcbPFOQhHbYGvRVSN5o/hishVFsESCOIr2rjI6DpKT060WpJWrs6ezhe3YAYMVH6NT56yWgmiG4h0yu0/TovLIlY2h3DeYyi+0l3vwEWBsqB9au/M5Pjg4EmCYAkaFNt01uXY89WoKLbprsSPjekGEJICFn7uB1BERycQZEOK4bvPZwdOKbzzrihmAF0FO5iSD/h9ZV/2LcvlHTDKWRrtEdq9jj1ZTBQn1ufTTiwqeK3hakSXVuxIxFDsifdNLG1Q== 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: 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++) From patchwork Fri Aug 23 10:19:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13774932 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 DE0FBC531DC for ; Fri, 23 Aug 2024 10:27:51 +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=iD0/H4MaXwi5m6Lep224sF/IcLmCoO8d9kwLMxcXtPg=; b=WZbvpMHkT+w0JzY188cvmTeCeP YLwSA5b5LxOcfS7g0h/hDUijpxJfylTW3nrhtQzjodeJkHFOKzx1tH2BfRk1FKqCvLNRhwNsWBr6v mxFa9kAJDNs7FS2TgVuygxyo9wK/HNRhgruDrSHMfxdH7I6Zk3NEZLaf/Zmr5lrJWfZuqBSLtGG0o VWTcuQprzCYMkm1Es4xFEtlAeHffSo1BK+34EJ8HraP4SF5bwXZPyKWqQo9/F4w7Z4OBYqXwhsIrD A+4qsZjS3flr9mp4YJUHUwfhZedBzK3FXJ4xj0DUiW401G7kfiLzeMCv3+tDe3IUXnLERhRSGkzu+ RZfL++ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shRWB-0000000GKhd-026b; Fri, 23 Aug 2024 10:27:43 +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 1shROm-0000000GJ3b-32jn for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 10:20:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WTy1U8PceOd6Is6gVcJ/pVpwS6G2RyFRDlwsxZSvSCemNJgqAfItU7l7bfVKnvzKScLNgRseX5zDaqmydOZ1Qta9LgbAqQkFg3zwz1ii2n/mr62pi9afQqih4fQ/edf+XdBJCLJdmL3C3y8LHIQWNk+07wJzlX+iP3cy1RNrf3+VvXXk2+uvxYSYLbGd6YCAKqM6zh6U7qin7mVCNm53s4Kgqal1yJ72tnF1Crh8gOlCaWwb7gEj5YVwSQ0yfvUInb1GlebgMDPZ3+Fwxwgz6EQuXeWhmW7bAProvhfki+gLZ8AGw30XTv9voZYwnwLvogyTm7twrfZv0fpkMsvDIg== 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=iD0/H4MaXwi5m6Lep224sF/IcLmCoO8d9kwLMxcXtPg=; b=QJkG6nOLyfXCr4Nkox0wdYntLIPAzg/4Rvntto6H3AYSfO3JwMwWwwhwWNKPbyVYjeM1z/cj+jNL8H0M8hxKkdGT9jdChxO9HsCvEPeeH+j8L+UMPLGPAxzvmOpcjpP+0Lc7zmCizhZ5nY2r+XtshjUS4vn/ZgGksYjzjln156cg9qN4+w5dqqZPXG4KnPbV2HpsV+yqJV5rVoxnhnaMnPmvyiwyNIENeMERsfV3QR2ZvM8EQBdV+1nL2BC6VP01Q03YtisDpuaBi1oR/F+Y3KsYJnyUJK9ceuH5XuFkvYm+Ebyl9uxZC/DOR8aw6O8otnAcTJVjWdDQe8K7J0wOvQ== 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=iD0/H4MaXwi5m6Lep224sF/IcLmCoO8d9kwLMxcXtPg=; b=LHHc0G5f5kgn0hDrqrgQfx6vTGfytvAA5RaB2Q2xlRwimj6dVcWrccSnuIY7lGBqtPDXrKQFFdXHV6SD332qZRo4UjPygA08mi3IMFs7GHJ0Ie8XrGtEvRt/gIK4iW0PvqMCDE0NXrKW4HNbtB8f01ySioakuboaJ6SL9daS0ufsNqwNfrySIGVL04GtN2N9NclzyayjL7Z5f6Y6Ve//EQ8dUPxHzIKtZww3hlasoWXlWCteFjBWFHJj4yNywXMDnntSrQ8U7kczEzYKyNZDfrvxnMKCURJo7Z+U9ZTqH9c97PPLO98P1E9zyBIp3eMr7Hfogt6mX2ykr3ACGKz0SA== 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:58 +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:58 +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 3/6] dma:imx-dma:Use devm_clk_get_enabled() helpers Date: Fri, 23 Aug 2024 18:19:30 +0800 Message-Id: <20240823101933.9517-4-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: 515ebd5c-3e2e-4a03-2d06-08dcc35d2436 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: 5AfOI8C+y9itBALuJNZnai2Rtu7bUvRcMmVq4tbqEBTO5Pxcp3B/0wxYcYpuUF3Pcmwxj8out6r7Z6sw+kHdVjf0j/iei5oyBQ+V/Y77mglGOaFi8Tf2a/sgKGNp88MIoAFizaVa/BWDMwPZjnEyHXb01lDmb8VgWb08eefMjYhn+uBX7tym5eZAlOJEu2gzk4scsuluEle7i+DNccMBCVbcbUAr8XgkU/Zs4WuCRPPptv/iD4gvgk/596B9+cOoEUFzlsa+vJgRZpZNTL5EIOO/ZfSHEpL7EZ+nG2cgV2zxdMFy1ftIMszGFFCEmfIuoGmmYQIWrcw2jW1GGeg3bs5ljG3RfReJIb1YZRf58r4rj2/jwSKqN0uXlbuu2zCrZFRX8NsuYReByHdbRWkZXTB9IokhDYnjHKkaWVEDFHzx681apM4e8OsLA/ZICimSVaEXtP1H2BErxXfhz1y+S3Vx0FNgiQ00Bt6rNyjPaUTOGnQOOy2MadGn4VYUP600oOWrgDBlfNDoJpICf8FyytB0pBzwrM9UYp8DQZ0xauL5o/MIKmJczw78Bqpq7QKSt/sG2datPOD50KPhsBfl6U37h6KNJUAuwdUfL3PRzbNUZ+BdRUJ8I5aNeijjTsk2MocO843yRLUixz+P11UfdoEI9C2oIV4j9psWVufF6i/RwC0OkxlrZfoCzgYvk8AlHGSZ8mAlN1022aF88w6NY3gFbIaXzVloNZlpBVQCGPDZs4PhjXPF/cV0bV4LSlYzocxqPclCBrYgKh2blivh7PqgOmPBMQV+qZJAoo4QUzhQnXPr10URStnF6VABy4VoKpVwy4tVhn5QUAshleQegpSkcVx1JofLaHWObGrSy16eln28S7Yt1digENYrBfhqP878sqBRwYdyScrPa+keyqypVub9R+2GKtTs2HQi1AAfEWFr3jck2W0hiiHldXOP2f8itlLyQSFv+VnB79/6wlLPM+G+gkTzLi66WPF/6V7sCPk8/6M2DuAeWULP3gUKv2eg8wvVvvIY4BYj5dCO4Spl+gfalAGtByFSZWc9/5VD43dL6B6w90GKOQ1g9M4GqgKTpGau6O29rsULLKUkyNKoMrUeIk5aPVgq1z6167+NGcEsaTPAcEsL4widQS732+tM0Gup2kV5ocw1NxOGBI/Cz2ErkOakolAyalIeZkO0f4umP/8MCnmLQC687+lp/0DXnySr5gWzxHave8Lg73lC5cfj5l6msjX8MwPESHPFgj6/Gz3wfFlwTVlDhw4M/9DnOheskIy8lK0NLgFJhliUWvZnhO9esD0GF94JKg2kvhsocl0Q6knZWKz6+TELZNuHRIDmqkrzHT3UXoeIn3AZKLVuORP3G2UTUinaDxRi7o0Y6ZKj2ncKKJHqs12gGeNrT2XIL6SKmnk8jWnyyg== 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: 2+phClZ43eQFr80FC3AcqTIe853fp5zHdZuB1Xb/HneNyBxtHBdVkPynKV/r5Qyn8yXQB9ydXVjK+H8kt2GKHyqJ0ROmxkvMv0rmx3vWHfJZR9fKQiIHYnKXrfWvJGKXjicjqmVX0q7JoDaYqLCY5UsOEL4FxzQS9sIffkc0kYZLBZsM6Ss/TIzgDBFmr2c6BzW0F7kvhWO8ryRWQYyWfmZQr0jOi+wYoHA55m/J2lKcgei5AZXrLrvePcwLacvuyqk09nQXaKP9b5gJuv9MNrNgSPLyNmeTc+0tjUZgjd1Rr2TozUQGQ4/OYRwxyUFSpkfVFU5Q6S/oVU4TUvlhhk71JQoMlIEKqQ2hdahbnKA/273fRjD5utgnBf1hdcUVJOm5gv3g7fpNdeQj8n8SPSmyIfw7GcV1wBlo8DMGeGWaJqreMsl+3+tl6F2F+RInAZ+MWdP7kZ+cdjUZYxZcQpQD/E1knHrqTGbnyJHD4BXGk5dqzFBFMk0us96/V+2YOB3x9iYHmRnA2U8u0JjluBsNfpr9iVrxpXxjsSEpmOdWBW2hGGhyzJqftVkUKLtc5jFZoK7gYcFbNjxaqaddpT4kZrGBNkhO5lephvvJoWT3jmWI0wDBR2voMX4v1V3I7YdmuugjaKGXAPpQJLpa9PIkORF7vRvPt3zmpo1PIbgmDlqnhxPmxDlZXnbYqNRHRirPDZ98Sd8Zx/aTJaOptNIU7xwHaaOt64Lpeu/dah+SjH3zzCZUHnU7dcdcYF4sVWb11T+XsFmVv8424odIyd0jbHyBmvyxDpV0xjJMxMPy0AsoOH+fte3bQFVWAJjgLMygc6lRy7+uN6wCHwsqOI5TM22AzvUexAnYT+wgTxv0tHnUSGoLoeIe5RbVDoXi+/QMAar9GlPXBxYeiS/5qRuX+auwfXu8WNCbWTxOOWDpVJNbtPnXozDNnI/l0+h8mGHbc5EHbo1TOdetKptc2QpafXjP/FOcgyjuogQNLt0uXR6/7lc4J8zFysHf6bVNOhlekFz4Oq+R3U0Usum3KxykcmiWccT7YTUj03k4Ip2wcRP5Um9PVCalfE0yCAF4vW/QDuKdx/zA/nSE58Myots8TmKYVgazjuOSDlDbAvDhn3Yncrpa7WKBatj6R2UofSOfFtlPJYJyCzLyRBTCeRWRGMDisaxv+FY+ookMetQdIpyu1eB53Qmo1zr0I4Er139VMaUmUoDRNPxBJyMNIROjMqb2ZyJhKZlRwgWYl02V11zJjk391w99jvYpLGbYumEUdiSOp2fcpfuO55CvuYMN+WgPfhUOWbw2zSDfxZQkTvhi6bOjDTxFI4mU6e12dTwFbxbKeG2SyrUKz7cxbVgP6490E8VVzzHJ2szBqMR+SFv4DAFqQDhDLYCA7nW5NqtA1/2mto/HfezBDCnNXAxJiGKfdbc4H5sPiWaaFVf93LNJ7IbhnUvmK03voNnu4fOUMudRbdjn+Ki0YkWXyB5QaZVG7rrhHUgkdYpgtPAjvr9B2HyYnYUtkeQIgcgSOlSDVsu0LaYbCaY9Bu9l64j5/PwtE2obQhdAFhTSU8v3QH4yOyTIPSbmpICcywOU X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 515ebd5c-3e2e-4a03-2d06-08dcc35d2436 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:58.8353 (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: /mnFax6UgzTXQotG6eIVwO3urDE2lp5U5zkBE7I9d7sNgfbT+ykKfJESyw1Xuz9NB2TU0mPcRUU0eX+Bor237Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB5873 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_032004_797707_2DDA3F32 X-CRM114-Status: GOOD ( 13.51 ) 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 imx-dma. Signed-off-by: Liao Yuanhong --- drivers/dma/imx-dma.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index ebf7c115d553..1ef926304d0e 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -1039,6 +1039,8 @@ static int __init imxdma_probe(struct platform_device *pdev) struct imxdma_engine *imxdma; int ret, i; int irq, irq_err; + struct clk *dma_ahb; + struct clk *dma_ipg; imxdma = devm_kzalloc(&pdev->dev, sizeof(*imxdma), GFP_KERNEL); if (!imxdma) @@ -1055,20 +1057,13 @@ static int __init imxdma_probe(struct platform_device *pdev) if (irq < 0) return irq; - imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg"); - if (IS_ERR(imxdma->dma_ipg)) - return PTR_ERR(imxdma->dma_ipg); + dma_ipg = devm_clk_get_enabled(&pdev->dev, "ipg"); + if (IS_ERR(dma_ipg)) + return PTR_ERR(dma_ipg); - imxdma->dma_ahb = devm_clk_get(&pdev->dev, "ahb"); - if (IS_ERR(imxdma->dma_ahb)) - return PTR_ERR(imxdma->dma_ahb); - - ret = clk_prepare_enable(imxdma->dma_ipg); - if (ret) - return ret; - ret = clk_prepare_enable(imxdma->dma_ahb); - if (ret) - goto disable_dma_ipg_clk; + dma_ahb = devm_clk_get_enabled(&pdev->dev, "ahb"); + if (IS_ERR(dma_ahb)) + return PTR_ERR(dma_ahb); /* reset DMA module */ imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR); @@ -1078,21 +1073,21 @@ static int __init imxdma_probe(struct platform_device *pdev) dma_irq_handler, 0, "DMA", imxdma); if (ret) { dev_warn(imxdma->dev, "Can't register IRQ for DMA\n"); - goto disable_dma_ahb_clk; + return ret; } imxdma->irq = irq; irq_err = platform_get_irq(pdev, 1); if (irq_err < 0) { ret = irq_err; - goto disable_dma_ahb_clk; + return ret; } ret = devm_request_irq(&pdev->dev, irq_err, imxdma_err_handler, 0, "DMA", imxdma); if (ret) { dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n"); - goto disable_dma_ahb_clk; + return ret; } imxdma->irq_err = irq_err; } @@ -1130,7 +1125,7 @@ static int __init imxdma_probe(struct platform_device *pdev) dev_warn(imxdma->dev, "Can't register IRQ %d " "for DMA channel %d\n", irq + i, i); - goto disable_dma_ahb_clk; + return ret; } imxdmac->irq = irq + i; @@ -1174,7 +1169,7 @@ static int __init imxdma_probe(struct platform_device *pdev) ret = dma_async_device_register(&imxdma->dma_device); if (ret) { dev_err(&pdev->dev, "unable to register\n"); - goto disable_dma_ahb_clk; + return ret; } if (pdev->dev.of_node) { @@ -1190,10 +1185,6 @@ static int __init imxdma_probe(struct platform_device *pdev) err_of_dma_controller: dma_async_device_unregister(&imxdma->dma_device); -disable_dma_ahb_clk: - clk_disable_unprepare(imxdma->dma_ahb); -disable_dma_ipg_clk: - clk_disable_unprepare(imxdma->dma_ipg); return ret; } @@ -1226,9 +1217,6 @@ static void imxdma_remove(struct platform_device *pdev) if (pdev->dev.of_node) of_dma_controller_free(pdev->dev.of_node); - - clk_disable_unprepare(imxdma->dma_ipg); - clk_disable_unprepare(imxdma->dma_ahb); } static struct platform_driver imxdma_driver = { From patchwork Fri Aug 23 10:19:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13774941 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 7F8B0C52D7C for ; Fri, 23 Aug 2024 10:28:39 +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=3CBKzRZVhAfE1GGxYtmoT4zKcdXQrw+66XZhjdFdUlc=; b=F9Emv4m3sco2mYyfvV/G/oI0DP pjW9c7oVyd8+Cz2OxKYdJFSUQ4ep2VIaOrroOKxCnYa/+mG0eqP8b+oyb+M6QchNJcNMTpdYUGJoK Drx2zAa+ihf7ly7rImtK+ukzTxZd+OeEOeySJoeWGgHMYIWFmTrYxRlDzdGjVPDUD8BpJ5T4nafnz nmw5AsmKD2k5XQpsV8cNVc9R1OkbZlAyZrvnJ94f3QpiiFDJ8QGnwr0zEajpvfD0QkdsUiMBWCrxh 8skfYQFkRvUPRnnkO768wzfHHzzhVFcVQiAEhS0nBONPm5MhyCJfQMsda1t4g2kZq5A7e5PnXKl14 fTDwR4LQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shRWu-0000000GKv7-0ILl; Fri, 23 Aug 2024 10:28:28 +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 1shROo-0000000GJ3b-3SOF for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 10:20:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q3PGVcbrHARtR7HniaR+T+fot47Q5qA1Spbutqdq503HXTphLbSAs9FDK1iFVs3R1+W+T1vwSpkv/HBrkFgDdvP4BJYfCXYZRRm0uJlHAmnCh2mCPOEEvexi9p5PGZFejTNTy31k2WBYR8uhWPJ3c6tyG0Fpwf9g+KdNZz+h1FBUdrm+1tfMisW3Ori2b1ycdFulrymuMWVoZ8Ixu8RW4pfi5r7JreYHIaq4RYkc/VIwvU+v9GN4/J74/NdAjpkwerLmyG12hWzVH5bfHti3RrY/5ipmkDT4z/9oxW9UIbz2QSNcaUTGXTKF7aOks7a3hB+Xso01sk/6VMbxzgFFZw== 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=3CBKzRZVhAfE1GGxYtmoT4zKcdXQrw+66XZhjdFdUlc=; b=DU4CnnlnszKEo3VRoejb8NsisXBltw1JrPewl0rw0GgAYS9Rxnj/GjSgItPt5zK5b69LJPQfixcXLyLZioDZByjnUAJiC+FPZmX7QlydzkI1uTCnaKIyOeY4m+nkxMVDid29R8eDPZdpWJec8yEsKhOZji3HQOTYC4CMIUkgwF+fB+kXgFOOEaTYOaW/736N5srrouPnSYDhqnWKr+yyMkk/lGkeXeRCzLhquswG1JsZM/pIHnJ3VxyhIsWC7T+0UZuoc2tBCS7HTi6lN92tMpFkfWRWltm/gEADYOJsOTpIg+mAVMY+YWKVNqXQo/xoSXQ41m8SJTiELF2qhwXAKg== 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=3CBKzRZVhAfE1GGxYtmoT4zKcdXQrw+66XZhjdFdUlc=; b=fZatAWIqgzWUtUFS2ujLUuxKhB6n6XSHsoZoYRVZkw4GECxVwiwExhNlQlv0k/8RiXBLvcCbvCJ/q5aYTgD6FGY7403mXK4D30Q+40dmpA9t3Blv2RQAyaiU6zuY2nXlIotXHQwIk/lQVGeH9xlnovPSeqvkcQkuatYq8xdd6f9dD8fRq51sXarLp6AQGj8F7mtvTWOyOXMUUXlNF0QPXNh0C6Ab9zuOf51JxToocv1t6t7VYoVPb2MDSvVPvU+MpbecG3j8xFys/RjX0oLEa6Ci3jW1PUabV0QDaNK9COz7zq1B2JRdNuXA/fqHNXotdyRPE6ZVgXUBSkOrQWGtmA== 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:00 +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:00 +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 4/6] dma:imx-sdma:Use devm_clk_get_enabled() helpers Date: Fri, 23 Aug 2024 18:19:31 +0800 Message-Id: <20240823101933.9517-5-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: ac8c3c1a-15f9-4031-bc9f-08dcc35d254c 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: TythpMkZUEvTaCK4kaDCEFE890PV5LPibumqqzlvdJpgCD/uPCw8XGb45FRx5GEn2HOeaaKZyXrStHQLE5xUZo0WE1XW2jzdoM4xBh7cfUn5CSW3nQzuasUs/lmDhB4WgepCmS2K7jRCSiYki+KRpj0akEGVxUux2QDKO5AFRWydMCJYsP6FxMOtvOlIGfBWLcZhwEYJ/JvfShOYSTcX7A9tt4/tXJRoizTddp5Wd5qMYfoYWF4n8dYTWadACEGfC7B+cOz/KMafx+k3ZpCOyVCcKohhUNMn7Ro5/fwTjCrEKX7SoKBYou8/s2D3huW48CnYM9byjAZkMbrTS+8lERY2VUKdlX/p8+XB14tINlZI3Ol6gr7glzyzTV1bBel6ay1PZ9pR3G1rFPwlYW9XvRFQnglu9KYv9Mto6tgvRL8GGXtXOI+LG+QV3A2nBUkKQzj+3S1OMFeftJ2QbZS0c5ZhFUh9qjCVD6V9Suyhwh35lhBrMsqJIxZHhZtJfKqWmGQNDYBFpmGLezo741jPP+KXfF42ePnFrDGjCClnnTRjXDC/MxknLQZBseJkrltAxSIBx9B2KGycnbMUkExIvw7N83U5cggN0i3ZY8sRNDep5t0AO/lqod2y5hDBidtNX29+d9ZesfXHbRQ55A7BLmPSg2Z9byI4szzjl4m+EFdCSea0pOClSpzxiWylqkvehV/qKVoPNVuMNDaVpG38nc2qxVMryzs9uey78qoFbvr3MoujNSodmdnPQK5PrAuMYyDgwNIAMIAFe0jI+N1stgfcY5ICNAR3Ky5QQYRM5CDvUB+ojhiVWWexgRpOjOZ5KU9oJy59/BadcW+Jk/mGhMfykrn6O+wC3moh1dlyUGIxAPUKL0dEz0dAMkKnRfkG1zJ1C49mBtv0nOMXZMSTmm+/JqeNe6k5JSyY6uJ9+SIpiRo6gyBXsBESlkkfjX0aZJsRi0FhwMaLkEEBU1SP3MSYDSBHCa6sZK2VV6v8DNfAGODoSjji/UpTsIKPGO1q5qbRkF0LNympCrJsXmzD3Iko1tleKcV1et27EXDrcpy/E05F0K5hyiXuvTzRvX32SteUYLa83jGkDsSGoLQz4PsAK/x/x2u3unz8I643NGcyhNCIW50lPD4uyLUdj3h5+8FaWhFC34l8a/4I0cpP9VzwGB+NeM0ndHlmiCcasH5fs5VZ0EuFkeH1zsp9KJ4L5jDfU6rh0Kpp/93owHKbBonDwzjZPCIJQGvpwskVuxQFMvt3/+nvezhrzgFjCwS0S8BoPlIUfPNVIsz1i1poNR2E2TFwQ4K0+lOEeL9HSnqbaeWG7NMfacj2tggusJLDpdcgLFb2sxXGgWwurc1E4v029FliHY5ewMi7fFX0F72LqA6dzdhSb8CVtB00SX6QmKlvW4rDxBOp6DE7l5aHFg== 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: tq9QgQ88NMgWv2nvbh2V2Kxz6o4Er18bTAMGVHdm8eUyJQ9d0jPR9YJeYulKiyX/BDXS69IghbimFgoKA2k+/FTJG3mkUDhJKcEgZ4+WDE9OGUOWFI/EQUWIPkKHdtyoLEmUf+7WG5bQWtNuxVyRz+qqSmIO4wB0oduNZlnBy50v2u5pLwSh9ng5fvG3MAAmfi+uJFEZSC0SUZPuFWX0yFGKbnYMSpNy310ul2vFlqCIqMeFbBUdWYZpX9ycjZ3VmP0VetDwn9NSRcy9HLzNIa6CybeqptZEZFxtNBDkVIyJRXF9yPxFUV9d8cp9sjjWk6wuWNvVqyuTFa8e/W2Fbamhi3BZUEkk7cOCucyxKeRyks/Htrcq/JMOe/ghbUAqbhDVhPbxEzhavtdQvlXk4j948VvqSD4+c5tmsHynqhdRHJRSKQYodYeA86IPaEFZPje/iQA5d/KXQaklC0xKYY9AlWV7xmRJ6mOenXftbdb0o5WlnWWNGwObAKRg4rBHLQ89+yudM4KHCjN2ujdrsE0gsu/SWaflCpS+/4j1BUTG6zusrehcecWdMRF5avovpRmK8YXEfbJgGoD9XaORkd0rY6/OYE3Q3yJqS4lapu4DTtXCtxLLRNlu7vNNPQNpeW5AuAa5Oo95ui9sKNIBA+ybz5Qv161mQ+/GSEVw9QChtR/n2ccKY0OdtajC5mf1V8U3GYQJgpBvQzRO8WMRMM6QefnPwqLsXOW7dKzROENEnJQF9m2PZix5/yfODUXJMh4Q0GQHKepC+QkdQxBHRXaBh0Q//bR8ofEWW4jvd27x3cW/6dFWcG9Nm8sCmuyVh0LbyUXzeN9Atf7qjxdB0Pue6wcTP4L1rhYe/ATa42MoBYZqFPaLvvqU724dg1KasTrJ6c1U4Qa4gsMAuMyDde6eIKsGT7EcQDEa/DspEwy8+mi7V+BnBzLTb1+y4B9VSk6lR7FhPnS7RTvPiSaSiIOk/zO3WzGop8ZgZMaIHeVbS/Z87iC9rUIu5A/bqZ29pB2ft7LDxzR5Jbe/IFL7ZoA9ZhGMtak94M35V329cmR7H+o7nZSg9M2yHKzMdF3xabW1Y04l1TDFFZuRWjP+Sao4x+XMb6djKghtxyZ3kl1As55yj9e3JZSQ7tu4AGSPl10GeGyxYZlFfKFn4bvVGpq9iY6qXq9D2aLWVMTRD7Gng/bHqovz31WREk48ngtS0T9NY6+igP3xfPX+nGNwJARIDyRUVX3+woMjtbTjCq+Is7VGmi6M6C64d4exWGYUycNSFrqpOsRROl39Q3ggFMIRQB2dtPPScdC44p+FDEMHRPfbRyhHDyFAvCnhJOAjE4VNVoGSLd7pZASG7FVadE0HMQUcIqwrVGLTfX4v0ZR/eSQ4FzYm4uEP6M96yGMIuIZiD9EexXqth7RNTFdnzeJUrXonstdcefoLRGbVMFiDX2o0BWJx2Xznx9Z9Jdx73xVE9G+AljCBqQ7S1D+MX19v5FQLb989B6U6Z/PT+Kn59ZmBx7+mfzH6YUz6ce/HLw68p15xYjdRodXTbqvwc6cHaLlvILTvvBvmfCAMjW4ykxTeAHyzm/0blxakmdie X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac8c3c1a-15f9-4031-bc9f-08dcc35d254c 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:00.6573 (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: kHtlHI6735Hbs/AiJJRTYjsJRRoxl6BU8OKTLFrE4oDA4CQqCSR8XfYZ6RIGo/0KDL7KeKdChl4NZZlKd6Wh8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB5873 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_032006_897533_E2FD3E4A X-CRM114-Status: GOOD ( 12.92 ) 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 imx-sdma. Signed-off-by: Liao Yuanhong --- drivers/dma/imx-sdma.c | 57 ++++-------------------------------------- 1 file changed, 5 insertions(+), 52 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 72299a08af44..af972a4b6ce1 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1493,24 +1493,11 @@ static int sdma_alloc_chan_resources(struct dma_chan *chan) sdmac->event_id0 = data->dma_request; sdmac->event_id1 = data->dma_request2; - ret = clk_enable(sdmac->sdma->clk_ipg); - if (ret) - return ret; - ret = clk_enable(sdmac->sdma->clk_ahb); - if (ret) - goto disable_clk_ipg; - ret = sdma_set_channel_priority(sdmac, prio); if (ret) - goto disable_clk_ahb; + return ret; return 0; - -disable_clk_ahb: - clk_disable(sdmac->sdma->clk_ahb); -disable_clk_ipg: - clk_disable(sdmac->sdma->clk_ipg); - return ret; } static void sdma_free_chan_resources(struct dma_chan *chan) @@ -1530,9 +1517,6 @@ static void sdma_free_chan_resources(struct dma_chan *chan) sdmac->event_id1 = 0; sdma_set_channel_priority(sdmac, 0); - - clk_disable(sdma->clk_ipg); - clk_disable(sdma->clk_ahb); } static struct sdma_desc *sdma_transfer_init(struct sdma_channel *sdmac, @@ -2015,14 +1999,10 @@ static void sdma_load_firmware(const struct firmware *fw, void *context) addr = (void *)header + header->script_addrs_start; ram_code = (void *)header + header->ram_code_start; - clk_enable(sdma->clk_ipg); - clk_enable(sdma->clk_ahb); /* download the RAM image for SDMA */ sdma_load_script(sdma, ram_code, header->ram_code_size, addr->ram_code_start_addr); - clk_disable(sdma->clk_ipg); - clk_disable(sdma->clk_ahb); sdma_add_scripts(sdma, addr); @@ -2119,13 +2099,6 @@ static int sdma_init(struct sdma_engine *sdma) dma_addr_t ccb_phys; int ccbsize; - ret = clk_enable(sdma->clk_ipg); - if (ret) - return ret; - ret = clk_enable(sdma->clk_ahb); - if (ret) - goto disable_clk_ipg; - if (sdma->drvdata->check_ratio && (clk_get_rate(sdma->clk_ahb) == clk_get_rate(sdma->clk_ipg))) sdma->clk_ratio = 1; @@ -2180,15 +2153,9 @@ static int sdma_init(struct sdma_engine *sdma) /* Initializes channel's priorities */ sdma_set_channel_priority(&sdma->channel[0], 7); - clk_disable(sdma->clk_ipg); - clk_disable(sdma->clk_ahb); - return 0; err_dma_alloc: - clk_disable(sdma->clk_ahb); -disable_clk_ipg: - clk_disable(sdma->clk_ipg); dev_err(sdma->dev, "initialisation failed with %d\n", ret); return ret; } @@ -2266,33 +2233,25 @@ static int sdma_probe(struct platform_device *pdev) if (IS_ERR(sdma->regs)) return PTR_ERR(sdma->regs); - sdma->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); + sdma->clk_ipg = devm_clk_get_enabled(&pdev->dev, "ipg"); if (IS_ERR(sdma->clk_ipg)) return PTR_ERR(sdma->clk_ipg); - sdma->clk_ahb = devm_clk_get(&pdev->dev, "ahb"); + sdma->clk_ahb = devm_clk_get_enabled(&pdev->dev, "ahb"); if (IS_ERR(sdma->clk_ahb)) return PTR_ERR(sdma->clk_ahb); - ret = clk_prepare(sdma->clk_ipg); - if (ret) - return ret; - - ret = clk_prepare(sdma->clk_ahb); - if (ret) - goto err_clk; - ret = devm_request_irq(&pdev->dev, irq, sdma_int_handler, 0, dev_name(&pdev->dev), sdma); if (ret) - goto err_irq; + return ret; sdma->irq = irq; sdma->script_addrs = kzalloc(sizeof(*sdma->script_addrs), GFP_KERNEL); if (!sdma->script_addrs) { ret = -ENOMEM; - goto err_irq; + return ret; } /* initially no scripts available */ @@ -2407,10 +2366,6 @@ static int sdma_probe(struct platform_device *pdev) dma_async_device_unregister(&sdma->dma_device); err_init: kfree(sdma->script_addrs); -err_irq: - clk_unprepare(sdma->clk_ahb); -err_clk: - clk_unprepare(sdma->clk_ipg); return ret; } @@ -2422,8 +2377,6 @@ static void sdma_remove(struct platform_device *pdev) devm_free_irq(&pdev->dev, sdma->irq, sdma); dma_async_device_unregister(&sdma->dma_device); kfree(sdma->script_addrs); - clk_unprepare(sdma->clk_ahb); - clk_unprepare(sdma->clk_ipg); /* Kill the tasklet */ for (i = 0; i < MAX_DMA_CHANNELS; i++) { struct sdma_channel *sdmac = &sdma->channel[i]; From patchwork Fri Aug 23 10:19:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Yuanhong X-Patchwork-Id: 13774929 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 BC047C52D7C for ; Fri, 23 Aug 2024 10:24:31 +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=32sXsE0QjPOmPp/lABxzJsY7N2 3Gl3PNKJmqdZGhY2sPdSfciIbjvAkgczZ+gEbLCZnAC/E56NMuA27wHMi9GfSpLqLlyjnnF3VddMN RsffPEnZBnEkUAggyIKYuChZX8S9o+bm+htOzvySmJ0A9CMS+3Fv1IFW+dTjVVzKYI3gO+b79MQZq IsIuws1sJn9o5Z0zXa1vNb4u+DZPPSr+u3SUNX3aMl/zAdRbJdaet8ZCu+s1XHy4wHmePN1sqgS8y lSL9VMR3k3hn3HTqE86gIV6B3rS4RfmE/RFMtM7DpbINXnRObzgLn9uert9O5EDy3Tt/TzPrMHNyp BkQeP1YQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shRSt-0000000GKB3-3bQr; Fri, 23 Aug 2024 10:24:19 +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 1shROq-0000000GJ3b-33II for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 10:20:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nw5MigdeKtc5GOT7pmXtUsPq73KCowNQj1O/yOMK5I5e0aTLeMvujEiZTKyEANf1YMq1xcocQur24VfClYCVgK5lDM2D5DNBgYDuu97JrkdEE3a75sZJ6YFVKxhbBa0a4OW/eb/tzEyC0XA6wSWqU2ITvbgmkDw/oOppmqXFgcTe0ImxbWziGgaBaq+2vxYp+GNeid+k/UeRjMVP6IqiSJxDIjU8Fh8lsennLayGqzTQXbi9CtMXfQGI6X8gODOt9ZneIO1eAVC8AW+3AGWQHuVcUWEFKXIl/W0CVdUZdQgaN5FQzw/zNCrrGHgO4uPDXLkBpVPPlqU1tnMBaBKJSQ== 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=ZFg8W0YzatdjYguO2aLbrFC6evH1R9NBW0MKxfw/x3DFlQCBulHYn3xKF3tiCoyE8LcYbaPFmABRyb8srtVUQ8xQXHNIVxHUsg+f/YRpS+L6IkGedp5AehV+ItE/+Lj1xrKNek3AHX8IlMnb9x70oQcZ8ZoHBqvewwEaehS3j/1tLi59PdaQzeWxDB1jlkvhRAreaZXSuPuOQWANDr8QrwJHFCWINWUX0ryCx4hNIL2IfI3GtX+XtsxycCkQWlOqo3ecyVJBG1ppcViyvsuOaqCH/HOjF5uvz4fYbfYplXd9hvleLIzsSpKSqCO9QswAv0GJnsFh77OFsNVWzeyYCA== 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=Tp3uEHIhP2wmBetx4bdRCJLS7l1lvqcqLe+1n5vX2d2SG0fLVm3o6jPOUBl59G2ewcocGfZ0zAAP1Jsnibt2bU/A4b+1knVHw56644wkYQjiaHO6hUPi6zmraq/PwZ3sSkYj2BXw3z0MQ8qcMpIfmWLixV/T9iIst1sbnOPE0FnGxqXEMjDYLHTcwoKqxiktx8uoMooGnPFEEHAOS07JN+roKgytzNXhzgCoZnw74kVyGmFg/Y5O/XOWmcdAqZCJxl4kATNCHqeuT8K+uITzB5TnX8gtgCGYTIJc0zaq8pViacQQeypF9nMJIfsKoiPz5T45vzM3S2WK4FlUpas5HA== 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:02 +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:02 +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 5/6] dma:milbeaut-hdmac:Use devm_clk_get_enabled() helpers Date: Fri, 23 Aug 2024 18:19:32 +0800 Message-Id: <20240823101933.9517-6-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: c080b9c2-5def-4573-a580-08dcc35d2662 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: 2XuxfTK5RZBYyjQ/zWewnwgRzkspuyFotiGaLq6j2dJrjQHVP3FScD+hjSh51OnJiQoZj9zRa8+COEtrRcUBmdqHfyRvGIYNsmx0eTimDame6v1KdaO0kRl8cZXZSI+YB9lomyIW0irusydka3ctK/neO55TKIf6xZGKShvsB5RLcCaDhZgX1Z9A9Lq0LUTA8JwKmy1S7rzv3/Tbw23lrLo3d0hGhTRjL9RWtGa8N2ewu9JiHgRwnvlq/c8U8RkXgHyfCRJ35oKPrslAMnJNTkd4Kf4rR1i6H/h6/V08mYSJlF7dUkJSzqc2rtXtdxMm75m6WSSie7BBgaCCily71krFeSsivHKPPj8ZAocBOHfCfJJSU44+erb5NDSJSZIlrk7ddOQEhOjAuoM2Gg/RFvR0jLIwtEmLZkY1VpW6vDeK10Pio+iXI7yMmKS7e6dbepv6SbigCzyiXcFDRk4zHUcNyzSv4oTQrGO/R4om/xtxTMDj/9QvyySKXvl1mpjfJYnccffvcvEjbKfi5uWM2PirWCj7CsG5Gk7iGNXFrORmQX87hB1PYX9hFKDWurUeEXTdD2KaYdI9ToOuZQIG0TPCGQc0OuHfzS5mdG3ZGyPyK9aEaKts+bde7FmlDuNtf7Xu59UixkwM337FQ3ryRlgc7q+wRoHlR844OP39NxhaRVolIkybgNgl+bn7vT2AYtqfC1Ftv6cZwB95c5RZMDtf84myRdDnaS3Rotqx5pZ6KCx1MZPahuUDlvCq37MXGVeqfCtvraWQiXT/SuN1APrEClIDPl5bGDJkYPNQd2md/elTLsLUn8/Z9WpJur/Xv0zS6w7wb2xtf9lOCrsPOItlXh1roIu5uHCJ/B+/rAKktcw8v+NmzhYMcFshNuWA/p+5lYaZ6TkMM6JCzxF6oXS4tZHpd183n3IWQ/g5I0RKBcpPl5d0fghG23tEY8b/TBnf5m8I7VATmXXvqWxPlaRzwGm3dBCcl34mu/e6VpqfJdEyScfXCr8l1I83y5ze7t1CPL+KaFbRjgyptFVw0RVMeoupb0G00Q2FaZm89+Yap6JPJue7IPcuYDeYk2GKrPsjjriW1PvJVoYC7o+9jkeD8jtqwF6YpzQEaBRQ28+pnTAo3c+WOe6LzBtXVw0jtywkhST5NCfPuiLdG3rHSwRJ9DMVpzuCcByzptUeFzXU7tV1+tBIEEE8nugx1tBZBT97udchiP9lcaOJI5TAefN7O/d8zcd+WN+rvsLaI+zyLJOSGcc9ozheaArALuRz2GFRST1K5E94Bt/Zrrx6Llg4hijIfNlTzoR5d13lyStl0uvPFPfLpr1D8CvwhyMk2llmME3N/frHTlaa541Wg5iVUQzgXLGHDwHSD4Kj5q1lVqW5eIsB2wmfTi+Tg4DepG5J9C2aciNePfSC4LsX1A== 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: MU6Q5TGJmDAC/Aui4r+dxrwtNX7u2S47vSTQoU6nr5ZUKQUHEzcehsItP7QbZhmNrx9xpv491tiTpkGjP1bA14BgOwuE2nGL9uJQ/jcaq2wBjzx5N4APX6zFONNFjkLzoHoLm8mah+840ZGUil96w5Q//aBulY93MD/nWpU+mw4Fwq9cz6/GGdtdS3sJMwoj0HqGvFIoSAGBnH0ME/3SKggNgDQU6lvu2jj9FbOiuJ5Hf2EcYMz+1TL/A4v038+x4uxUpgeq/jf8OZA3Mw4+qpiCdH2s8LfM3ixhSM/fwoJWsps8pSz2NrSXBtQG0wI2Bk5IZB6J+aadbXfj03OGcH0w0zmnCswnQCrV75gDtYBPOlxiJ/m4l36gEVK00nuyhhCMgzErGj0yKN557Xs7CBGDIRGHdnMF2deCo9UYj4q4g/mLA9fZVWorHCXp+3No7Q9exxYywCgInmrzvGIr7Pe+yuMNyRJpIfPspOY69NWDf8vDypiDpTB8r8kFKO6EB3Tr23ws+P04+Pa3aHYy5brdt0VnI58Bk57sBt1X3Ml2y8sQCUbhcwg0K27SqcUTbAdKhWjuPJXhWE+r9JH3Hh3gTgTWm1Aq3vuBMB1dPd76ofueJaQ3JHww8lAgzrq4jLM1Ckbv8L6kNZSc9MwsKsAxYfA5BATS4juyTs4+ipRfmNPlwt4Qn+BMRHIdB7zg02PPLsFv8t+4WGLS2lpT6Qv/Au3tVhpSveu4CdkWyfqfAPL191DshvHpbcKfAXB/vejgH0GYqNiK72IfrcHQQw4ZT9Or7t8iOStwllkvkUJNAnSWEniDRr0sAzunyd8VHgrVs+Brj90rMxuA9slYfnLG1qOvfgmLjY2mbp32cyTWZazGLkgbyqBTL9lWZU/iLdmsZsdaQ3KNFwROZkXhAXZxcfzktak1OgNdA/DvGL/ZJg341nj8gSg31HESZll76BaW49YE0HOom/auQXIb0tlSowrJH3dy/bSgcd2cT5Fog90y0jEpYgx/KAoM8dF4GP6FI0wCdG37EhTsqoy1oyRLb5Onvu45s/3DMFLyhQOKmtB/af/MprCn6a14fBPiFYJwHWNibeFWtAoGzO5jnRo+cwBhWlUztVWb60eugmFMSQ+AsmPHUe8HHoiP8PzSd9P8ZNmyq1vFSjOahcBN8k5xuTqnqj+JB/KscLuoDIyy1AcPn26lXCwWETwVk7rV/Y9W9OKfT3CK2r/ovm07xMf8+2F+QR+RZ9r0qrKKGWKYXzSgJ3cw4lO5LV09m9vNEk5bo9n9mujOgaw1Xcvf6FrfoLxyxTwFYl13V+eFM+CbrumTJQQP3wGsLuKBQF4MjOb3Mcoon5Qvk4zCqEqnaZ5hPWzDDs+nj12kH2fQ17YxLTMG11H94qQJzr5p9oyUX6gdSIkZuJrDMRYyUuuZ26YyYPrmnE68TIlLDmke+CTks0eTn+NxiHl5JTM0oSw6Zrb5iSLhzLXxs69z4ZH6HP5CWeWy/WogwTXp0+SsGhk/JeRSLJJnEtKxwva5wr80TO7+dXHql1Ozjyixdbg6XefrVGCWZMKM4rNijka94kOBKemIl9NdAItqnyU/+V52 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c080b9c2-5def-4573-a580-08dcc35d2662 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:02.4809 (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: Yltom0lIg4s/6ShKbal8+dbjvGIU3ZPaozcTnpN7g81CmyuWLfEE5zokKQFlQYFFgAz9OpkKamEbec7qndvnfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYUPR06MB5873 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_032008_790368_9158D613 X-CRM114-Status: GOOD ( 13.41 ) 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 Reviewed-by: Jonathan Cameron --- 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[] = { 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[] = {