diff options
author | Hartmut Knaack <knaack.h@gmx.de> | 2015-06-16 00:48:24 +0300 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-07-19 13:48:09 +0300 |
commit | c13c9da6d86fa9cb6449deb6c71b18ffcf32ae53 (patch) | |
tree | a3b0aa1b107e4c1bacdb89a8214731960799aa84 /drivers/iio | |
parent | bd7bd0cc3a60e082b17a4f64ce76831aa1c6dffe (diff) | |
download | linux-c13c9da6d86fa9cb6449deb6c71b18ffcf32ae53.tar.xz |
iio:accel:bmc150-accel: fix counting direction
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 <knaack.h@gmx.de>
Reviewed-by: Octavian Purdila <octavian.purdila@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/accel/bmc150-accel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/accel/bmc150-accel.c b/drivers/iio/accel/bmc150-accel.c index 4e70f51c2370..cc5a35750b50 100644 --- a/drivers/iio/accel/bmc150-accel.c +++ b/drivers/iio/accel/bmc150-accel.c @@ -1464,7 +1464,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; |