From mboxrd@z Thu Jan 1 00:00:00 1970 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 7575ECA0FE1 for ; Fri, 30 Aug 2024 12:25:35 +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:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JsatiJs2BiRW1udvq9plsKA5Hg+RhwBtq5Fu6FP56jQ=; b=EK9h3GRlCv12kAItrYRiDAzF2l s7S317dBcafg4R7CJrJ2lWO6cDrRTC5GOQ0mKPMu8hERLUfTn+pYwDyJ65s/77a39ouGQNMAcqAyX bIQYa5gvqkhlHLMK1IKlhXKc5MrJu8PBiSzpSSdCvhS3+6g7BlHXpMiFITRBvQLiP3xBjkbS/i9Jb V9bD49xMgUk16YBQ4b79pPO36RlL9lD4Gbcz/+48t/dMnaAVfND0tK2M3QXlLSwKJBeBWvRcPAr8b +8y1Rkb+R3ORcgI1upJcMSATLPumBtm2HVkAHfEP1e/kO0Jt1SfPAxLBER3F787ZwhLbvzQgeCytx 1BTn8SeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sk0gr-00000006CNS-3pXx; Fri, 30 Aug 2024 12:25:22 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sk0fy-00000006C7h-0Ez1 for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 12:24:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1725020666; x=1756556666; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=cLyAG02PLUqREwBipCL05oGCPOekRFHbgr03E3ZyY1Q=; b=k5nxM8sKczFiCUP8OyyJkhaipipVNe4zkEunRBukUI9SrnNyIVv+qAvI +HtRsfbGORks/C5zffsTfoNWlqtAiCDW2z4PlytkG3mAonctz/QNBxu2/ ax9liSamjGUAMbNBGEVmBU5bRLE5duxl91+9kBRQUtAXb8TPF7auzYBzK bFgA2PM+lNfKo/owcryGT+k1vrU/Ju92G8oqnlw8uv19TB5IHp8m6DiPC VZqrQ72o+h8ua1+8Z5Aoaawoq2J/XuUM2Q+zd8sxTrfFZo7yMIGvUWY7L xk2xMQh+fTlUilT+G5GhVq8KCLl+/4kTJGfuikM82KPbyzyjIU3RS5FC3 g==; X-CSE-ConnectionGUID: jhUv9V1rRKaOEQO/6ledWg== X-CSE-MsgGUID: NRqdXd9sSZeGPjy2o7JxcQ== X-IronPort-AV: E=Sophos;i="6.10,188,1719903600"; d="scan'208";a="31097803" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Aug 2024 05:24:24 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 30 Aug 2024 05:23:58 -0700 Received: from [10.159.224.217] (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 30 Aug 2024 05:23:57 -0700 Message-ID: <8ddf8cc7-0611-4c04-b814-be13ae14dedf@microchip.com> Date: Fri, 30 Aug 2024 14:24:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/7] dmaengine:at_hdmac:Use devm_clk_get_enabled() helpers Content-Language: en-US, fr-FR To: Liao Yuanhong , CC: , , , References: <20240830094118.15458-1-liaoyuanhong@vivo.com> <20240830094118.15458-3-liaoyuanhong@vivo.com> From: Nicolas Ferre Organization: microchip In-Reply-To: <20240830094118.15458-3-liaoyuanhong@vivo.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_052426_188568_FAF03B01 X-CRM114-Status: GOOD ( 18.55 ) 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 On 30/08/2024 at 11:41, Liao Yuanhong wrote: > Use devm_clk_get_enabled() instead of clk functions in at_hdmac. I don't see how it could work: so please disregard at_hdmac when playing with "simplification". No subsequent version of this thing please. NACK (again). Best regards, Nicolas > Signed-off-by: Liao Yuanhong > --- > v2:remove modifications related to the resume operation. > --- > drivers/dma/at_hdmac.c | 16 ++-------------- > 1 file changed, 2 insertions(+), 14 deletions(-) > > diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c > index 40052d1bd0b5..2274aeb58271 100644 > --- a/drivers/dma/at_hdmac.c > +++ b/drivers/dma/at_hdmac.c > @@ -1975,20 +1975,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"); > + atdma->clk = devm_clk_get_enabled(&pdev->dev, "dma_clk"); > if (IS_ERR(atdma->clk)) > return PTR_ERR(atdma->clk); > > - err = clk_prepare_enable(atdma->clk); > - if (err) > - return err; > - > /* 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 +2101,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,16 +2124,11 @@ 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) > { > - 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 +2183,6 @@ static int at_dma_suspend_noirq(struct device *dev) > > /* disable DMA controller */ > at_dma_off(atdma); > - clk_disable_unprepare(atdma->clk); > return 0; > } > > -- > 2.25.1 > >