mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Liao Yuanhong <liaoyuanhong@vivo.com>
Cc: vkoul@kernel.org, dmaengine@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v2 5/7] dmaengine:imx-sdma:Use devm_clk_get_prepared() helpers
Date: Fri, 30 Aug 2024 11:11:15 -0400	[thread overview]
Message-ID: <ZtHhE6RQP6f/2NsI@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20240830094118.15458-6-liaoyuanhong@vivo.com>

On Fri, Aug 30, 2024 at 05:41:16PM +0800, Liao Yuanhong wrote:
> Use devm_clk_get_prepared() instead of clk functions in imx-sdma.
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>

Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> v2:remove all enable related modifications, replace clk_prepare() with
> devm_clk_get_prepared()
> ---
>  drivers/dma/imx-sdma.c | 22 ++++------------------
>  1 file changed, 4 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 72299a08af44..07a017c40a82 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -2266,33 +2266,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_prepared(&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_prepared(&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 +2399,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 +2410,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];
> --
> 2.25.1
>

  reply	other threads:[~2024-08-30 15:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30  9:41 [PATCH v2 0/7] dmaengine:Use devm_clk_get_enabled() helpers Liao Yuanhong
2024-08-30  9:41 ` [PATCH v2 1/7] dmaengine:Add COMPILE_TEST for easy testing Liao Yuanhong
2024-08-30 17:44   ` Krzysztof Kozlowski
2024-08-31 13:15   ` kernel test robot
2024-08-31 21:31   ` kernel test robot
2024-08-30  9:41 ` [PATCH v2 2/7] dmaengine:at_hdmac:Use devm_clk_get_enabled() helpers Liao Yuanhong
2024-08-30 12:24   ` Nicolas Ferre
2024-08-30  9:41 ` [PATCH v2 3/7] dmaengine:dma-jz4780:Use " Liao Yuanhong
2024-08-30  9:41 ` [PATCH v2 4/7] dmaengine:imx-dma:Use " Liao Yuanhong
2024-08-30 15:12   ` Frank Li
2024-08-30  9:41 ` [PATCH v2 5/7] dmaengine:imx-sdma:Use devm_clk_get_prepared() helpers Liao Yuanhong
2024-08-30 15:11   ` Frank Li [this message]
2024-08-30  9:41 ` [PATCH v2 6/7] dmaengine:milbeaut-hdmac:Use devm_clk_get_enabled() helpers Liao Yuanhong
2024-08-30  9:41 ` [PATCH v2 7/7] dmaengine:uniphier-mdmac:Use " Liao Yuanhong
2024-08-30 18:11 ` [PATCH v2 0/7] dmaengine:Use " Krzysztof Kozlowski
2024-09-03  5:18   ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZtHhE6RQP6f/2NsI@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=liaoyuanhong@vivo.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®