From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>,
<linux-amlogic@lists.infradead.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-i2c@vger.kernel.org>
Cc: <wsa@kernel.org>, <narmstrong@baylibre.com>, <tanure@linux.com>
Subject: [PATCH -next] i2c: meson: fix missing clk_disable_unprepare() on error in meson_i2c_probe()
Date: Thu, 21 Apr 2022 17:00:42 +0800 [thread overview]
Message-ID: <20220421090042.2278081-1-yangyingliang@huawei.com> (raw)
Fix the missing clk_disable_unprepare() before return
from meson_i2c_probe() in the error handling case.
Fixes: a57f9b4dd6f5 ("i2c: meson: Use 50% duty cycle for I2C clock")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/i2c/busses/i2c-meson.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c
index 50dab123380a..195a9716da31 100644
--- a/drivers/i2c/busses/i2c-meson.c
+++ b/drivers/i2c/busses/i2c-meson.c
@@ -520,8 +520,10 @@ static int meson_i2c_probe(struct platform_device *pdev)
meson_i2c_set_mask(i2c, REG_SLAVE_ADDR,
REG_SLV_SDA_FILTER_MASK | REG_SLV_SCL_FILTER_MASK, 0);
- if (!i2c->data->set_clk_div)
+ if (!i2c->data->set_clk_div) {
+ clk_disable_unprepare(i2c->clk);
return -EINVAL;
+ }
i2c->data->set_clk_div(i2c, timings.bus_freq_hz);
ret = i2c_add_adapter(&i2c->adap);
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-04-21 8:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 9:00 Yang Yingliang [this message]
2022-04-21 10:04 ` [PATCH -next] i2c: meson: fix missing clk_disable_unprepare() on error in meson_i2c_probe() Neil Armstrong
2022-05-04 20:38 ` Wolfram Sang
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=20220421090042.2278081-1-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=narmstrong@baylibre.com \
--cc=tanure@linux.com \
--cc=wsa@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