Re: [PATCH] staging: iio: ad9834: add a check for devm_clk_get

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 17 Oct 2019 12:56:33 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@xxxxxxxxxx> wrote:

> On Wed, 2019-10-16 at 22:25 +0800, Chuhong Yuan wrote:
> > ad9834_probe misses a check for devm_clk_get and may cause problems.
> > Add a check like what ad9832 does to fix it.
> >   
> 
> This could also use a Fixes tag, but not a big deal.
> 
> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@xxxxxxxxxx>

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

As a general point though, the fact that a devm error handler
actually has things to do suggests this code doesn't pass
the obviously correct test.

Nothing to do with this patch mind you!

Jonathan

> 
> > Signed-off-by: Chuhong Yuan <hslester96@xxxxxxxxx>
> > ---
> >  drivers/staging/iio/frequency/ad9834.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/staging/iio/frequency/ad9834.c
> > b/drivers/staging/iio/frequency/ad9834.c
> > index 038d6732c3fd..23026978a5a5 100644
> > --- a/drivers/staging/iio/frequency/ad9834.c
> > +++ b/drivers/staging/iio/frequency/ad9834.c
> > @@ -417,6 +417,10 @@ static int ad9834_probe(struct spi_device *spi)
> >  	st = iio_priv(indio_dev);
> >  	mutex_init(&st->lock);
> >  	st->mclk = devm_clk_get(&spi->dev, NULL);
> > +	if (IS_ERR(st->mclk)) {
> > +		ret = PTR_ERR(st->mclk);
> > +		goto error_disable_reg;
> > +	}
> >  
> >  	ret = clk_prepare_enable(st->mclk);
> >  	if (ret) {  

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux