]> Git Repo - linux.git/commitdiff
iio:accel:bmc150-accel: fix counting direction
authorHartmut Knaack <[email protected]>
Mon, 15 Jun 2015 21:48:24 +0000 (23:48 +0200)
committerJonathan Cameron <[email protected]>
Sun, 21 Jun 2015 13:42:28 +0000 (14:42 +0100)
In bmc150_accel_unregister_triggers() triggers should be unregistered in
reverse order of registration. Trigger registration starts with number 0,
counting up. In consequence, trigger number needs to be count down here.

Signed-off-by: Hartmut Knaack <[email protected]>
Reviewed-by: Octavian Purdila <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
drivers/iio/accel/bmc150-accel.c

index 73e87739d2191831187ab30416b4111dcfda8ecc..bf827d012a71492a2088e91dd364cfacc245febd 100644 (file)
@@ -1465,7 +1465,7 @@ static void bmc150_accel_unregister_triggers(struct bmc150_accel_data *data,
 {
        int i;
 
-       for (i = from; i >= 0; i++) {
+       for (i = from; i >= 0; i--) {
                if (data->triggers[i].indio_trig) {
                        iio_trigger_unregister(data->triggers[i].indio_trig);
                        data->triggers[i].indio_trig = NULL;
This page took 0.058559 seconds and 4 git commands to generate.