From: Chen Lifu <chenlifu@huawei.com>
To: <lkundrak@v3.sk>, <linux@armlinux.org.uk>, <olof@lixom.net>,
<pavel@ucw.cz>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Cc: <chenlifu@huawei.com>
Subject: [PATCH -next] ARM: mmp: Add missing clk_disable_unprepare() in mmp_dt_init_timer()
Date: Wed, 7 Sep 2022 14:14:54 +0800 [thread overview]
Message-ID: <20220907061454.3800923-1-chenlifu@huawei.com> (raw)
mmp_dt_init_timer() may have called clk_prepare_enable() before return
from failed branches, add missing clk_disable_unprepare() in these cases.
Fixes: f36797ee4380 ("ARM: mmp/mmp2: dt: enable the clock")
Signed-off-by: Chen Lifu <chenlifu@huawei.com>
---
arch/arm/mach-mmp/time.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 41b2e8abc9e6..6d2db1fea1be 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -207,16 +207,20 @@ static int __init mmp_dt_init_timer(struct device_node *np)
} else {
rate = 3250000;
}
irq = irq_of_parse_and_map(np, 0);
- if (!irq)
+ if (!irq) {
+ clk_disable_unprepare(clk);
return -EINVAL;
+ }
mmp_timer_base = of_iomap(np, 0);
- if (!mmp_timer_base)
+ if (!mmp_timer_base) {
+ clk_disable_unprepare(clk);
return -ENOMEM;
+ }
mmp_timer_init(irq, rate);
return 0;
}
--
2.37.1
next reply other threads:[~2022-09-07 6:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 6:14 Chen Lifu [this message]
2022-10-08 8:43 ` chenlifu
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=20220907061454.3800923-1-chenlifu@huawei.com \
--to=chenlifu@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lkundrak@v3.sk \
--cc=olof@lixom.net \
--cc=pavel@ucw.cz \
/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®