iio: xilinx-xadc: Remove `irq` field from state struct
Subsystems (2)
PATCH 1/1 iio: xilinx-xadc: Remove `irq` field from state struct
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.
--- drivers/iio/adc/xilinx-xadc-core.c | 5 ++--- drivers/iio/adc/xilinx-xadc.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/iio/adc/xilinx-xadc-core.c +2 -3
@@ -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;
drivers/iio/adc/xilinx-xadc.h +0 -1
@@ -67,7 +67,6 @@ struct xadc {spinlock_t lock;struct completion completion; -int irq; };enum xadc_type {
Signature · 1 line
2.20.1
Jonathan Cameron
maintainerQuoted 8 lines · On Sun, 17 Oct 2021 14:15:51 +0200 Lars-Peter Clausen <[email protected]> wrote:
Since commit
2a9685d1a3b7("iio: adc: xilinx: use more devres helpers and removeremove()") theirqfield from XADC driver state struct is only used in theprobe()function.Use the local
irqvariable throughout theprobe()function and remove the now unused field from the state struct.Signed-off-by Lars-Peter Clausen <[email protected]>
Make sense.
Applied to the iio-togreg branch of iio.git and pushed out as testing for all the normal reasons.
Thanks,
Jonathan
Quoted 47 lines
--- drivers/iio/adc/xilinx-xadc-core.c | 5 ++--- drivers/iio/adc/xilinx-xadc.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-)drivers/iio/adc/xilinx-xadc-core.c +2
-3@@ -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;drivers/iio/adc/xilinx-xadc.h +0
-1@@ -67,7 +67,6 @@ struct xadc {spinlock_t lock;struct completion completion; -int irq; };enum xadc_type {