From: Jonathan Cameron <jic23@kernel.org>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Rick Altherr <raltherr@google.com>
Subject: Re: [PATCH] iio: Aspeed ADC - Handle return value of clk_prepare_enable
Date: Sat, 3 Jun 2017 09:50:18 +0100 [thread overview]
Message-ID: <20170603095018.0d0f680b@kernel.org> (raw)
In-Reply-To: <4d7cbfdca6b7e89a312a08dad6c49b3289299bd8.1496041572.git.arvind.yadav.cs@gmail.com>
On Mon, 29 May 2017 13:12:12 +0530
Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:
> clk_prepare_enable() can fail here and we must check its return value.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Please make sure to cc the driver author. This is a fairly new
driver, so chances are Rick will still be answering this email
address.
Patch looks fine to me, but I would like to give Rick the opportunity
to respond.
Jonathan
> ---
> drivers/iio/adc/aspeed_adc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
> index 62670cb..e0ea411 100644
> --- a/drivers/iio/adc/aspeed_adc.c
> +++ b/drivers/iio/adc/aspeed_adc.c
> @@ -212,7 +212,10 @@ static int aspeed_adc_probe(struct platform_device *pdev)
> }
>
> /* Start all channels in normal mode. */
> - clk_prepare_enable(data->clk_scaler->clk);
> + ret = clk_prepare_enable(data->clk_scaler->clk);
> + if (ret)
> + goto clk_enable_error;
> +
> adc_engine_control_reg_val = GENMASK(31, 16) |
> ASPEED_OPERATION_MODE_NORMAL | ASPEED_ENGINE_ENABLE;
> writel(adc_engine_control_reg_val,
> @@ -236,6 +239,7 @@ static int aspeed_adc_probe(struct platform_device *pdev)
> writel(ASPEED_OPERATION_MODE_POWER_DOWN,
> data->base + ASPEED_REG_ENGINE_CONTROL);
> clk_disable_unprepare(data->clk_scaler->clk);
> +clk_enable_error:
> clk_hw_unregister_divider(data->clk_scaler);
>
> scaler_error:
next prev parent reply other threads:[~2017-06-03 8:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-29 7:42 [PATCH] iio: Aspeed ADC - Handle return value of clk_prepare_enable Arvind Yadav
2017-06-03 8:50 ` Jonathan Cameron [this message]
2017-06-05 16:56 ` Rick Altherr
2017-06-11 14:08 ` Jonathan Cameron
2017-06-05 17:06 ` Rick Altherr
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=20170603095018.0d0f680b@kernel.org \
--to=jic23@kernel.org \
--cc=arvind.yadav.cs@gmail.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=raltherr@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.