mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Wilczynski <m.wilczynski@samsung.com>
To: Johan Hovold <johan@kernel.org>,
	Drew Fustini <fustini@kernel.org>, Guo Ren <guoren@kernel.org>,
	Fu Wei <wefu@redhat.com>, Jassi Brar <jassisinghbrar@gmail.com>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mailbox: th1520: fix clock imbalance on probe failure
Date: Tue, 21 Oct 2025 20:36:03 +0200	[thread overview]
Message-ID: <e8a0782a-4e63-45a6-85c8-e3113b1f391a@samsung.com> (raw)
In-Reply-To: <20251017055414.7753-1-johan@kernel.org>



On 10/17/25 07:54, Johan Hovold wrote:
> The purpose of the devm_add_action_or_reset() helper is to call the
> action function in case adding an action ever fails so drop the clock
> disable from the error path to avoid disabling the clocks twice.
> 
> Fixes: 5d4d263e1c6b ("mailbox: Introduce support for T-head TH1520 Mailbox driver")
> Cc: Michal Wilczynski <m.wilczynski@samsung.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  drivers/mailbox/mailbox-th1520.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mailbox/mailbox-th1520.c b/drivers/mailbox/mailbox-th1520.c
> index a6b2aa9ae952..626957c2e435 100644
> --- a/drivers/mailbox/mailbox-th1520.c
> +++ b/drivers/mailbox/mailbox-th1520.c
> @@ -435,10 +435,8 @@ static int th1520_mbox_probe(struct platform_device *pdev)
>  	}
>  
>  	ret = devm_add_action_or_reset(dev, th1520_disable_clk, priv);
> -	if (ret) {
> -		clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clocks), priv->clocks);
> +	if (ret)
>  		return ret;
> -	}
>  
>  	/*
>  	 * The address mappings in the device tree align precisely with those

Hi,
Thanks for your fix. I believe it is correct as devm_add_action_or_reset
will call th1520_disable_clk on failure, like you noticed.

Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com>

Best regards,
-- 
Michal Wilczynski <m.wilczynski@samsung.com>

  reply	other threads:[~2025-10-21 18:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20251017055521eucas1p1344f04a5012eb6981315cf160ffc1ec6@eucas1p1.samsung.com>
2025-10-17  5:54 ` Johan Hovold
2025-10-21 18:36   ` Michal Wilczynski [this message]
2025-11-10  9:13   ` Johan Hovold
2025-11-26 16:24     ` Johan Hovold
2025-11-29 16:44       ` Drew Fustini
2025-12-01  9:36         ` Johan Hovold
2025-11-10 19:11   ` Drew Fustini

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=e8a0782a-4e63-45a6-85c8-e3113b1f391a@samsung.com \
    --to=m.wilczynski@samsung.com \
    --cc=fustini@kernel.org \
    --cc=guoren@kernel.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=wefu@redhat.com \
    /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®