linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: dac: ad5592r: remove usage of iio_priv_to_dev() helper
@ 2020-05-25 13:10 Alexandru Ardelean
  2020-05-31 14:32 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandru Ardelean @ 2020-05-25 13:10 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

This was partially removed when the mlock cleanup was done. Only one more
call is left in the ad5592r_alloc_channels() function.
This one is simple. We just need to pass the iio_dev object and get the
state via iio_priv().

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/iio/dac/ad5592r-base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
index 410e90e5f75f..272c97bb841c 100644
--- a/drivers/iio/dac/ad5592r-base.c
+++ b/drivers/iio/dac/ad5592r-base.c
@@ -508,11 +508,11 @@ static void ad5592r_setup_channel(struct iio_dev *iio_dev,
 	chan->ext_info = ad5592r_ext_info;
 }
 
-static int ad5592r_alloc_channels(struct ad5592r_state *st)
+static int ad5592r_alloc_channels(struct iio_dev *iio_dev)
 {
+	struct ad5592r_state *st = iio_priv(iio_dev);
 	unsigned i, curr_channel = 0,
 		 num_channels = st->num_channels;
-	struct iio_dev *iio_dev = iio_priv_to_dev(st);
 	struct iio_chan_spec *channels;
 	struct fwnode_handle *child;
 	u32 reg, tmp;
@@ -636,7 +636,7 @@ int ad5592r_probe(struct device *dev, const char *name,
 	if (ret)
 		goto error_disable_reg;
 
-	ret = ad5592r_alloc_channels(st);
+	ret = ad5592r_alloc_channels(iio_dev);
 	if (ret)
 		goto error_disable_reg;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: dac: ad5592r: remove usage of iio_priv_to_dev() helper
  2020-05-25 13:10 [PATCH] iio: dac: ad5592r: remove usage of iio_priv_to_dev() helper Alexandru Ardelean
@ 2020-05-31 14:32 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2020-05-31 14:32 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Mon, 25 May 2020 16:10:34 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> This was partially removed when the mlock cleanup was done. Only one more
> call is left in the ad5592r_alloc_channels() function.
> This one is simple. We just need to pass the iio_dev object and get the
> state via iio_priv().
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to poke at.

Thanks,

Jonathan

> ---
>  drivers/iio/dac/ad5592r-base.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
> index 410e90e5f75f..272c97bb841c 100644
> --- a/drivers/iio/dac/ad5592r-base.c
> +++ b/drivers/iio/dac/ad5592r-base.c
> @@ -508,11 +508,11 @@ static void ad5592r_setup_channel(struct iio_dev *iio_dev,
>  	chan->ext_info = ad5592r_ext_info;
>  }
>  
> -static int ad5592r_alloc_channels(struct ad5592r_state *st)
> +static int ad5592r_alloc_channels(struct iio_dev *iio_dev)
>  {
> +	struct ad5592r_state *st = iio_priv(iio_dev);
>  	unsigned i, curr_channel = 0,
>  		 num_channels = st->num_channels;
> -	struct iio_dev *iio_dev = iio_priv_to_dev(st);
>  	struct iio_chan_spec *channels;
>  	struct fwnode_handle *child;
>  	u32 reg, tmp;
> @@ -636,7 +636,7 @@ int ad5592r_probe(struct device *dev, const char *name,
>  	if (ret)
>  		goto error_disable_reg;
>  
> -	ret = ad5592r_alloc_channels(st);
> +	ret = ad5592r_alloc_channels(iio_dev);
>  	if (ret)
>  		goto error_disable_reg;
>  


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-31 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 13:10 [PATCH] iio: dac: ad5592r: remove usage of iio_priv_to_dev() helper Alexandru Ardelean
2020-05-31 14:32 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).