All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: xilinx-xadc: Remove `irq` field from state struct
@ 2021-10-17 12:15 Lars-Peter Clausen
  2021-10-17 15:02 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2021-10-17 12:15 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen

Since commit 2a9685d1a3b7 ("iio: adc: xilinx: use more devres helpers and
remove remove()") the `irq` field from XADC driver state struct is only
used in the `probe()` function.

Use the local `irq` variable throughout the `probe()` function and remove
the now unused field from the state struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/adc/xilinx-xadc-core.c | 5 ++---
 drivers/iio/adc/xilinx-xadc.h      | 1 -
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 198d2916266d..83bea5ef765d 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1332,7 +1332,6 @@ static int xadc_probe(struct platform_device *pdev)
 
 	xadc = iio_priv(indio_dev);
 	xadc->ops = id->data;
-	xadc->irq = irq;
 	init_completion(&xadc->completion);
 	mutex_init(&xadc->mutex);
 	spin_lock_init(&xadc->lock);
@@ -1397,7 +1396,7 @@ static int xadc_probe(struct platform_device *pdev)
 		}
 	}
 
-	ret = devm_request_irq(dev, xadc->irq, xadc->ops->interrupt_handler, 0,
+	ret = devm_request_irq(dev, irq, xadc->ops->interrupt_handler, 0,
 			       dev_name(dev), indio_dev);
 	if (ret)
 		return ret;
@@ -1407,7 +1406,7 @@ static int xadc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = xadc->ops->setup(pdev, indio_dev, xadc->irq);
+	ret = xadc->ops->setup(pdev, indio_dev, irq);
 	if (ret)
 		return ret;
 
diff --git a/drivers/iio/adc/xilinx-xadc.h b/drivers/iio/adc/xilinx-xadc.h
index 8b80195725e9..7d78ce698967 100644
--- a/drivers/iio/adc/xilinx-xadc.h
+++ b/drivers/iio/adc/xilinx-xadc.h
@@ -67,7 +67,6 @@ struct xadc {
 	spinlock_t lock;
 
 	struct completion completion;
-	int irq;
 };
 
 enum xadc_type {
-- 
2.20.1


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

* Re: [PATCH] iio: xilinx-xadc: Remove `irq` field from state struct
  2021-10-17 12:15 [PATCH] iio: xilinx-xadc: Remove `irq` field from state struct Lars-Peter Clausen
@ 2021-10-17 15:02 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2021-10-17 15:02 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: linux-iio

On Sun, 17 Oct 2021 14:15:51 +0200
Lars-Peter Clausen <lars@metafoo.de> wrote:

> Since commit 2a9685d1a3b7 ("iio: adc: xilinx: use more devres helpers and
> remove remove()") the `irq` field from XADC driver state struct is only
> used in the `probe()` function.
> 
> Use the local `irq` variable throughout the `probe()` function and remove
> the now unused field from the state struct.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Make sense.

Applied to the iio-togreg branch of iio.git and pushed out as testing for
all the normal reasons.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/xilinx-xadc-core.c | 5 ++---
>  drivers/iio/adc/xilinx-xadc.h      | 1 -
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
> index 198d2916266d..83bea5ef765d 100644
> --- a/drivers/iio/adc/xilinx-xadc-core.c
> +++ b/drivers/iio/adc/xilinx-xadc-core.c
> @@ -1332,7 +1332,6 @@ static int xadc_probe(struct platform_device *pdev)
>  
>  	xadc = iio_priv(indio_dev);
>  	xadc->ops = id->data;
> -	xadc->irq = irq;
>  	init_completion(&xadc->completion);
>  	mutex_init(&xadc->mutex);
>  	spin_lock_init(&xadc->lock);
> @@ -1397,7 +1396,7 @@ static int xadc_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	ret = devm_request_irq(dev, xadc->irq, xadc->ops->interrupt_handler, 0,
> +	ret = devm_request_irq(dev, irq, xadc->ops->interrupt_handler, 0,
>  			       dev_name(dev), indio_dev);
>  	if (ret)
>  		return ret;
> @@ -1407,7 +1406,7 @@ static int xadc_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	ret = xadc->ops->setup(pdev, indio_dev, xadc->irq);
> +	ret = xadc->ops->setup(pdev, indio_dev, irq);
>  	if (ret)
>  		return ret;
>  
> diff --git a/drivers/iio/adc/xilinx-xadc.h b/drivers/iio/adc/xilinx-xadc.h
> index 8b80195725e9..7d78ce698967 100644
> --- a/drivers/iio/adc/xilinx-xadc.h
> +++ b/drivers/iio/adc/xilinx-xadc.h
> @@ -67,7 +67,6 @@ struct xadc {
>  	spinlock_t lock;
>  
>  	struct completion completion;
> -	int irq;
>  };
>  
>  enum xadc_type {


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

end of thread, other threads:[~2021-10-17 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-17 12:15 [PATCH] iio: xilinx-xadc: Remove `irq` field from state struct Lars-Peter Clausen
2021-10-17 15:02 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.