Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Tomislav Denis <tomislav.denis@avl.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Heiko Stuebner <heiko@sntech.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	linux-iio@vger.kernel.org,
	Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>,
	Vladimir Zapolskiy <vz@mleia.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Antoniu Miclaus <antoniu.miclaus@analog.com>,
	kernel@pengutronix.de,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Nuno Sa <nuno.sa@analog.com>,
	Michal Simek <michal.simek@xilinx.com>
Subject: Re: [PATCH 11/13] iio: frequency: admv1013: Benefit from devm_clk_get_enabled() to simplify
Date: Sat, 13 Aug 2022 17:37:06 +0100	[thread overview]
Message-ID: <20220813173706.1cb77958@jic23-huawei> (raw)
In-Reply-To: <20220808204740.307667-11-u.kleine-koenig@pengutronix.de>

On Mon,  8 Aug 2022 22:47:38 +0200
Uwe Kleine-König         <u.kleine-koenig@pengutronix.de> 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@gmail.com>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Looks fine to me, but there is a subtle reordering + it does even more
non parsing stuff in a function called _parse.

Anyhow, would like Antoniu or someone else from ADI to take a quick look if
possible before I pick this one up.

> ---
>  drivers/iio/frequency/admv1013.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c
> index b0e1f6571afb..1346d77df77f 100644
> --- a/drivers/iio/frequency/admv1013.c
> +++ b/drivers/iio/frequency/admv1013.c
> @@ -490,11 +490,6 @@ static int admv1013_init(struct admv1013_state *st)
>  					  st->input_mode);
>  }
>  
> -static void admv1013_clk_disable(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
>  static void admv1013_reg_disable(void *data)
>  {
>  	regulator_disable(data);
> @@ -559,7 +554,7 @@ static int admv1013_properties_parse(struct admv1013_state *st)
>  		return dev_err_probe(&spi->dev, PTR_ERR(st->reg),
>  				     "failed to get the common-mode voltage\n");
>  
> -	st->clkin = devm_clk_get(&spi->dev, "lo_in");
> +	st->clkin = devm_clk_get_enabled(&spi->dev, "lo_in");
>  	if (IS_ERR(st->clkin))
>  		return dev_err_probe(&spi->dev, PTR_ERR(st->clkin),
>  				     "failed to get the LO input clock\n");
> @@ -601,14 +596,6 @@ static int admv1013_probe(struct spi_device *spi)
>  	if (ret)
>  		return ret;
>  
> -	ret = clk_prepare_enable(st->clkin);
> -	if (ret)
> -		return ret;
> -
> -	ret = devm_add_action_or_reset(&spi->dev, admv1013_clk_disable, st->clkin);
> -	if (ret)
> -		return ret;
> -
>  	st->nb.notifier_call = admv1013_freq_change;
>  	ret = devm_clk_notifier_register(&spi->dev, st->clkin, &st->nb);
>  	if (ret)


  reply	other threads:[~2022-08-13 16:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 20:47 [PATCH 01/13] iio: adc: ad7124: Benefit from devm_clk_get_enabled() to simplify Uwe Kleine-König
2022-08-08 20:47 ` [PATCH 02/13] iio: adc: ad7768-1: " Uwe Kleine-König
2022-08-08 20:47 ` [PATCH 03/13] iio: adc: ad9467: " Uwe Kleine-König
2022-08-08 20:47 ` [PATCH 04/13] iio: adc: ad9467: Benefit from devm_clk_get_prepared() " Uwe Kleine-König
2022-08-08 21:01   ` Andy Shevchenko
2022-08-09  5:37     ` [PATCH 04/13] iio: adc: ingenic-adc: " Uwe Kleine-König
2022-08-13 16:19       ` Jonathan Cameron
2022-08-08 20:47 ` [PATCH 05/13] iio: adc: lpc18xx: Benefit from devm_clk_get_enabled() " Uwe Kleine-König
2022-08-13 16:25   ` Jonathan Cameron
2022-08-08 20:47 ` [PATCH 06/13] iio: adc: rockchip_saradc: " Uwe Kleine-König
2022-08-13 16:31   ` Jonathan Cameron
2022-08-14 19:01     ` Andy Shevchenko
2022-08-14 21:30       ` Uwe Kleine-König
2022-08-15  7:30         ` Andy Shevchenko
2022-08-15  7:41           ` Uwe Kleine-König
2022-08-16  8:20             ` Andy Shevchenko
2022-08-16  8:27               ` Lars-Peter Clausen
2022-08-16  8:38                 ` Lars-Peter Clausen
2022-08-20 11:42                   ` Jonathan Cameron
2022-08-08 20:47 ` [PATCH 07/13] iio: adc: ti-ads131e08: " Uwe Kleine-König
2022-08-08 20:47 ` [PATCH 08/13] iio: adc: xilinx-ams: " Uwe Kleine-König
2022-08-08 20:47 ` [PATCH 09/13] iio: adc: xilinx-xadc: " Uwe Kleine-König
2022-08-08 20:47 ` [PATCH 10/13] iio: frequency: adf4371: " Uwe Kleine-König
2022-08-08 20:47 ` [PATCH 11/13] iio: frequency: admv1013: " Uwe Kleine-König
2022-08-13 16:37   ` Jonathan Cameron [this message]
2022-08-14 19:04     ` Andy Shevchenko
2022-08-20 11:45       ` Jonathan Cameron
2022-08-08 20:47 ` [PATCH 12/13] iio: frequency: adrf6780: " Uwe Kleine-König
2022-08-08 20:47 ` [PATCH 13/13] iio: imu: adis16475: " Uwe Kleine-König
2022-08-13 16:39 ` [PATCH 01/13] iio: adc: ad7124: " Jonathan Cameron

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=20220813173706.1cb77958@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=anand.ashok.dumbre@xilinx.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=antoniu.miclaus@analog.com \
    --cc=heiko@sntech.de \
    --cc=kernel@pengutronix.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=nuno.sa@analog.com \
    --cc=paul@crapouillou.net \
    --cc=tomislav.denis@avl.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vz@mleia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox