]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging:iio:adc:ad7606 refactor to remove st->irq and st->id.
authorJonathan Cameron <jic23@cam.ac.uk>
Fri, 30 Sep 2011 09:05:42 +0000 (10:05 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 23:07:05 +0000 (16:07 -0700)
id wasn't used anywhere and st->irq can be removed by simply
passing it into the core remove function (trivially available in
the two bus implementations).

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/adc/ad7606.h
drivers/staging/iio/adc/ad7606_core.c
drivers/staging/iio/adc/ad7606_par.c
drivers/staging/iio/adc/ad7606_spi.c

index bc95f09327aacc4f1157c4a064cc84cc6b15e76e..0d1bb261c79310d3dc26681412d00e468d8d3765 100644 (file)
@@ -69,8 +69,6 @@ struct ad7606_state {
        struct work_struct              poll_work;
        wait_queue_head_t               wq_data_avail;
        const struct ad7606_bus_ops     *bops;
-       int                             irq;
-       unsigned                        id;
        unsigned                        range;
        unsigned                        oversampling;
        bool                            done;
@@ -94,7 +92,7 @@ void ad7606_resume(struct iio_dev *indio_dev);
 struct iio_dev *ad7606_probe(struct device *dev, int irq,
                              void __iomem *base_address, unsigned id,
                              const struct ad7606_bus_ops *bops);
-int ad7606_remove(struct iio_dev *indio_dev);
+int ad7606_remove(struct iio_dev *indio_dev, int irq);
 int ad7606_reset(struct ad7606_state *st);
 
 enum ad7606_supported_device_ids {
index e762acb8fc2bfcbab79479eba9003b3a707c9b80..3c0fb729891a38b5f9c91edc17b583a7dc2149f0 100644 (file)
@@ -459,8 +459,6 @@ struct iio_dev *ad7606_probe(struct device *dev, int irq,
        st = iio_priv(indio_dev);
 
        st->dev = dev;
-       st->id = id;
-       st->irq = irq;
        st->bops = bops;
        st->base_address = base_address;
        st->range = pdata->default_range == 10000 ? 10000 : 5000;
@@ -501,7 +499,7 @@ struct iio_dev *ad7606_probe(struct device *dev, int irq,
        if (ret)
                dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n");
 
-       ret = request_irq(st->irq, ad7606_interrupt,
+       ret = request_irq(irq, ad7606_interrupt,
                IRQF_TRIGGER_FALLING, st->chip_info->name, indio_dev);
        if (ret)
                goto error_free_gpios;
@@ -527,7 +525,7 @@ error_cleanup_ring:
        ad7606_ring_cleanup(indio_dev);
 
 error_free_irq:
-       free_irq(st->irq, indio_dev);
+       free_irq(irq, indio_dev);
 
 error_free_gpios:
        ad7606_free_gpios(st);
@@ -543,14 +541,14 @@ error_ret:
        return ERR_PTR(ret);
 }
 
-int ad7606_remove(struct iio_dev *indio_dev)
+int ad7606_remove(struct iio_dev *indio_dev, int irq)
 {
        struct ad7606_state *st = iio_priv(indio_dev);
 
        iio_buffer_unregister(indio_dev);
        ad7606_ring_cleanup(indio_dev);
 
-       free_irq(st->irq, indio_dev);
+       free_irq(irq, indio_dev);
        if (!IS_ERR(st->reg)) {
                regulator_disable(st->reg);
                regulator_put(st->reg);
index d21218da923f9e9bfe357aef817e60fb2ccd76a7..688632edd3d76c411244af8802b7c444170b819d 100644 (file)
@@ -106,7 +106,7 @@ static int __devexit ad7606_par_remove(struct platform_device *pdev)
        struct resource *res;
        struct ad7606_state *st = iio_priv(indio_dev);
 
-       ad7606_remove(indio_dev);
+       ad7606_remove(indio_dev, platform_get_irq(pdev, 0));
 
        iounmap(st->base_address);
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
index 0769c807d95f39e735ce30900433e37aca4e3801..aede1ba5e041429b30020820a84f1d9eb121ac65 100644 (file)
@@ -59,7 +59,7 @@ static int __devexit ad7606_spi_remove(struct spi_device *spi)
 {
        struct iio_dev *indio_dev = dev_get_drvdata(&spi->dev);
 
-       return ad7606_remove(indio_dev);
+       return ad7606_remove(indio_dev, spi->irq);
 }
 
 #ifdef CONFIG_PM