From: Qinglang Miao <miaoqinglang@huawei.com>
To: Robin Murphy <robin.murphy@arm.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 20:04:23 +0800 [thread overview]
Message-ID: <c86c7e85-31ec-725f-ed75-563c804868c7@huawei.com> (raw)
In-Reply-To: <50da9bf1-7317-b24b-9a87-e9dfb4e4a694@arm.com>
在 2020/11/3 19:11, Robin Murphy 写道:
> 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.
You are right Robin, thanks a lot! :D
I've sent a 'real' v2 patch based on your advice.
>
>> -
>> + }
>> return ret;
>> }
>> #endif
>>
> .
next prev parent reply other threads:[~2020-11-03 12:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 7:49 Qinglang Miao
2020-11-03 8:20 ` Qinglang Miao
2020-11-03 11:11 ` Robin Murphy
2020-11-03 12:04 ` Qinglang Miao [this message]
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=c86c7e85-31ec-725f-ed75-563c804868c7@huawei.com \
--to=miaoqinglang@huawei.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=pmeerw@pmeerw.net \
--cc=robin.murphy@arm.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®