[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20170611150859.5072bc9a@kernel.org>
Date: Sun, 11 Jun 2017 15:08:59 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Rick Altherr <raltherr@...gle.com>
Cc: Arvind Yadav <arvind.yadav.cs@...il.com>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
linux-iio@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] iio: Aspeed ADC - Handle return value of
clk_prepare_enable
On Mon, 5 Jun 2017 09:56:25 -0700
Rick Altherr <raltherr@...gle.com> wrote:
> Reviewed-by: Rick Altherr <raltherr@...gle.com>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
>
> On Sat, Jun 3, 2017 at 1:50 AM, Jonathan Cameron <jic23@...nel.org> wrote:
>
> > On Mon, 29 May 2017 13:12:12 +0530
> > Arvind Yadav <arvind.yadav.cs@...il.com> wrote:
> >
> > > clk_prepare_enable() can fail here and we must check its return value.
> > >
> > > Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.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:
> >
> >
Powered by blists - more mailing lists