]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
staging:iio: Make sure all triggers have a trigger_ops for the owner field.
authorJonathan Cameron <jic23@kernel.org>
Wed, 14 Dec 2011 20:49:30 +0000 (20:49 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Dec 2011 18:56:25 +0000 (10:56 -0800)
The core needs the owner field to prevent module removal whilst in use and
uses it without confirming that the trigger_ops structure actually exists.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/adc/ad7192.c
drivers/staging/iio/adc/ad7793.c

index 66cc507ab4d246ebb5e07f460bddb5cfd883a5c7..6114601ec4785ce8527cb0d0c0c806f388b3ee1a 100644 (file)
@@ -609,6 +609,10 @@ static irqreturn_t ad7192_data_rdy_trig_poll(int irq, void *private)
        return IRQ_HANDLED;
 }
 
+static struct iio_trigger_ops ad7192_trigger_ops = {
+       .owner = THIS_MODULE,
+};
+
 static int ad7192_probe_trigger(struct iio_dev *indio_dev)
 {
        struct ad7192_state *st = iio_priv(indio_dev);
@@ -621,7 +625,7 @@ static int ad7192_probe_trigger(struct iio_dev *indio_dev)
                ret = -ENOMEM;
                goto error_ret;
        }
-
+       st->trig->ops = &ad7192_trigger_ops;
        ret = request_irq(st->spi->irq,
                          ad7192_data_rdy_trig_poll,
                          IRQF_TRIGGER_LOW,
index 4047c5d205e19a6a4fb9336e12c7fdf0715eed66..6e03bfbacd344d6215b2f7b917a0f93f24125598 100644 (file)
@@ -475,6 +475,10 @@ static irqreturn_t ad7793_data_rdy_trig_poll(int irq, void *private)
        return IRQ_HANDLED;
 }
 
+static struct iio_trigger_ops ad7793_trigger_ops = {
+       .owner = THIS_MODULE,
+};
+
 static int ad7793_probe_trigger(struct iio_dev *indio_dev)
 {
        struct ad7793_state *st = iio_priv(indio_dev);
@@ -487,6 +491,7 @@ static int ad7793_probe_trigger(struct iio_dev *indio_dev)
                ret = -ENOMEM;
                goto error_ret;
        }
+       st->trig->ops = &ad7793_trigger_ops;
 
        ret = request_irq(st->spi->irq,
                          ad7793_data_rdy_trig_poll,