The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Jiawen Liu <1298662399@qq.com>, Ben Dooks <ben-linux@fluff.org>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	<linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: sdhci-s3c: check clk_prepare_enable return in probe
Date: Mon, 24 Aug 2026 09:20:50 +0300	[thread overview]
Message-ID: <dfcde50d-2ea8-4b7e-b140-9263d43d288b@intel.com> (raw)
In-Reply-To: <tencent_76880DF24877C8490B50E7D7BC52A55EA105@qq.com>

On 18/08/2026 16:07, Jiawen Liu wrote:
> sdhci_s3c_probe() ignores the return value of
> clk_prepare_enable(sc->clk_io). If this call fails, the clock is not
> enabled, but the driver continues and later calls
> clk_disable_unprepare() on it, leading to an unbalanced clock
> disable/unprepare.
> 
> Fix this by checking the return value and propagating the error,
> cleaning up only resources acquired before the failed enable.
> 
> Signed-off-by: jiawen <1298662399@qq.com>

scripts/checkpatch.pl says:

WARNING: From:/Signed-off-by: email name mismatch: 'From: Jiawen Liu <1298662399@qq.com>' != 'Signed-off-by: jiawen <1298662399@qq.com>'

Please adjust that.

> ---
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -534,7 +534,11 @@
>  	}
>  
>  	/* enable the local io clock and keep it running for the moment. */
> -	clk_prepare_enable(sc->clk_io);
> +	ret = clk_prepare_enable(sc->clk_io);
> +	if (ret) {
> +		dev_err(dev, "failed to enable io clock\n");
> +		return ret;
> +	}
>  
>  	for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
>  		char name[14];
> 


      parent reply	other threads:[~2026-08-24  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 13:07 [PATCH] mmc: sdhci-s3c: check clk_prepare_enable return in probe Jiawen Liu
2026-08-20  8:52 ` Markus Elfring
2026-08-24  6:20 ` Adrian Hunter [this message]

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=dfcde50d-2ea8-4b7e-b140-9263d43d288b@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=1298662399@qq.com \
    --cc=ben-linux@fluff.org \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.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