Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1656759
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] iio: Aspeed ADC - Handle return value of clk_prepare_enable |
| Date | 2017-06-03 11:00 +0200 |
| Message-ID | <tOd4B-4OP-1@gated-at.bofh.it> (permalink) |
| References | <tMnB7-56h-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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:
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] iio: Aspeed ADC - Handle return value of clk_prepare_enable Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-05-29 09:50 +0200
Re: [PATCH] iio: Aspeed ADC - Handle return value of clk_prepare_enable Jonathan Cameron <jic23@kernel.org> - 2017-06-03 11:00 +0200
Re: [PATCH] iio: Aspeed ADC - Handle return value of clk_prepare_enable Rick Altherr <raltherr@google.com> - 2017-06-05 19:10 +0200
csiph-web