]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
staging:iio:triggers reorder module put and device put to ensure that the ops are...
authorJonathan Cameron <jic23@cam.ac.uk>
Wed, 24 Aug 2011 16:28:34 +0000 (17:28 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 24 Aug 2011 21:23:41 +0000 (14:23 -0700)
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/trigger.h

index 325e086e9e6867d9640e1c44745e5994e4562958..234c77433434bcca1edb082f0f64b7fb79576133 100644 (file)
@@ -104,14 +104,14 @@ static inline struct iio_trigger *to_iio_trigger(struct device *d)
 
 static inline void iio_put_trigger(struct iio_trigger *trig)
 {
-       put_device(&trig->dev);
        module_put(trig->ops->owner);
+       put_device(&trig->dev);
 };
 
 static inline void iio_get_trigger(struct iio_trigger *trig)
 {
-       __module_get(trig->ops->owner);
        get_device(&trig->dev);
+       __module_get(trig->ops->owner);
 };
 
 /**