All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: dmaengine@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Frank Li <Frank.Li@kernel.org>, Vinod Koul <vkoul@kernel.org>,
	Viresh Kumar <vireshk@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Serge Semin <fancer.lancer@gmail.com>
Subject: Re: [PATCH v2] dmaengine: dw: Use devm_clk_get_optional_enabled() in dw_probe()
Date: Fri, 20 Nov 2026 10:37:52 -0600	[thread overview]
Message-ID: <awB3YOGuJO6nZAGx@SMW015318> (raw)
In-Reply-To: <4267a49d-89b0-4564-b22b-995de017f52b@web.de>

On Fri, Nov 20, 2026 at 03:13:01PM +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 20 Nov 2026 14:23:13 +0100

Any tools issue ? your patch look strange. Why this information at body

>
> * Reuse existing functionality from devm_clk_get_optional_enabled()
>   instead of keeping duplicate source code.

Needn't *

>
> * Omit a clk_disable_unprepare() call on an error handling path
>   and in the implementation of the function “dw_remove”.

Clean up disable_unprepare() at error handling patch and dw_remove()

Frank

>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>
> V2:
> Andy Shevchenko and Frank Li requested further adjustments according to
> the proposed changes.
>
>
>  drivers/dma/dw/platform.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
> index 7e76391475ac..13c44ee5e047 100644
> --- a/drivers/dma/dw/platform.c
> +++ b/drivers/dma/dw/platform.c
> @@ -64,12 +64,9 @@ static int dw_probe(struct platform_device *pdev)
>
>  	data->chip = chip;
>
> -	chip->clk = devm_clk_get_optional(chip->dev, "hclk");
> +	chip->clk = devm_clk_get_optional_enabled(chip->dev, "hclk");
>  	if (IS_ERR(chip->clk))
>  		return PTR_ERR(chip->clk);
> -	ret = clk_prepare_enable(chip->clk);
> -	if (ret)
> -		return ret;
>
>  	pm_runtime_enable(&pdev->dev);
>
> @@ -87,7 +84,6 @@ static int dw_probe(struct platform_device *pdev)
>
>  err_dw_dma_probe:
>  	pm_runtime_disable(&pdev->dev);
> -	clk_disable_unprepare(chip->clk);
>  	return ret;
>  }
>
> @@ -106,7 +102,6 @@ static void dw_remove(struct platform_device *pdev)
>  		dev_warn(chip->dev, "can't remove device properly: %d\n", ret);
>
>  	pm_runtime_disable(&pdev->dev);
> -	clk_disable_unprepare(chip->clk);
>  }
>
>  static void dw_shutdown(struct platform_device *pdev)
> --
> 2.56.1
>

  reply	other threads:[~2026-11-20 16:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 14:13 [PATCH v2] dmaengine: dw: Use devm_clk_get_optional_enabled() in dw_probe() Markus Elfring
2026-11-20 16:37 ` Frank Li [this message]
2026-11-20 17:09   ` [v2] " Markus Elfring

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=awB3YOGuJO6nZAGx@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=Markus.Elfring@web.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vireshk@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.