On Mon, 8 Aug 2022 22:47:28 +0200 Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> wrote: > Make use of devm_clk_get_enabled() to replace some code that effectively > open codes this new function. > > Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> Always good to have a cover letter on series with lots of patches. If nothing else it gives somewhere for replies to the whole series. I'm a bit nervous about the ordering changes in 6 and 11 so want to give those a little more time to get review. Applied all the rest to what will be the togreg branch of iio.git after a rebase on rc1. For now pushed out as testing for 0-day to see if it can find any problems we missed. Thanks, Jonathan > --- > drivers/iio/adc/ad7124.c | 15 +-------------- > 1 file changed, 1 insertion(+), 14 deletions(-) > > diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c > index c5b785d8b241..4088786e1026 100644 > --- a/drivers/iio/adc/ad7124.c > +++ b/drivers/iio/adc/ad7124.c > @@ -936,11 +936,6 @@ static void ad7124_reg_disable(void *r) > regulator_disable(r); > } > > -static void ad7124_clk_disable(void *c) > -{ > - clk_disable_unprepare(c); > -} > - > static int ad7124_probe(struct spi_device *spi) > { > const struct ad7124_chip_info *info; > @@ -993,18 +988,10 @@ static int ad7124_probe(struct spi_device *spi) > return ret; > } > > - st->mclk = devm_clk_get(&spi->dev, "mclk"); > + st->mclk = devm_clk_get_enabled(&spi->dev, "mclk"); > if (IS_ERR(st->mclk)) > return PTR_ERR(st->mclk); > > - ret = clk_prepare_enable(st->mclk); > - if (ret < 0) > - return ret; > - > - ret = devm_add_action_or_reset(&spi->dev, ad7124_clk_disable, st->mclk); > - if (ret) > - return ret; > - > ret = ad7124_soft_reset(st); > if (ret < 0) > return ret; > > base-commit: 8b3d743fc9e2542822826890b482afabf0e7522a