From: Robin Murphy <robin.murphy@arm.com>
To: Qinglang Miao <miaoqinglang@huawei.com>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Heiko Stuebner <heiko@sntech.de>
Cc: linux-iio@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
Date: Tue, 3 Nov 2020 11:11:34 +0000 [thread overview]
Message-ID: <50da9bf1-7317-b24b-9a87-e9dfb4e4a694@arm.com> (raw)
In-Reply-To: <20201103074909.195465-1-miaoqinglang@huawei.com>
On 2020-11-03 07:49, Qinglang Miao wrote:
> Fix the missing clk_disable_unprepare() of info->pclk
> before return from rockchip_saradc_resume in the error
> handling case when fails to prepare and enable info->clk.
>
> Fixes: 44d6f2ef94f9 ("iio: adc: add driver for Rockchip saradc")
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> ---
> drivers/iio/adc/rockchip_saradc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
> index 1f3d7d639..5eb566274 100644
> --- a/drivers/iio/adc/rockchip_saradc.c
> +++ b/drivers/iio/adc/rockchip_saradc.c
> @@ -461,9 +461,10 @@ static int rockchip_saradc_resume(struct device *dev)
> return ret;
>
> ret = clk_prepare_enable(info->clk);
> - if (ret)
> + if (ret) {
> + clk_disable_unprepare(info->pclk);
> return ret;
No need to add braces, just replace this utterly pointless "early" return ;)
Robin.
> -
> + }
> return ret;
> }
> #endif
>
next prev parent reply other threads:[~2020-11-03 11:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 7:49 [PATCH v2] iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume Qinglang Miao
2020-11-03 8:20 ` Qinglang Miao
2020-11-03 11:11 ` Robin Murphy [this message]
2020-11-03 12:04 ` Qinglang Miao
2020-11-03 12:07 Qinglang Miao
2020-11-08 15:41 ` Jonathan Cameron
2020-11-21 16:39 ` Jonathan Cameron
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=50da9bf1-7317-b24b-9a87-e9dfb4e4a694@arm.com \
--to=robin.murphy@arm.com \
--cc=heiko@sntech.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=miaoqinglang@huawei.com \
--cc=pmeerw@pmeerw.net \
/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;
as well as URLs for NNTP newsgroup(s).