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 */