summaryrefslogtreecommitdiffstats
path: root/drivers/iio/accel
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-06-15 23:48:24 +0200
committerJonathan Cameron <jic23@kernel.org>2015-06-21 14:42:28 +0100
commit7a1d0d91c94305fa5802a53df3a54c0ea1963c48 (patch)
treec54195fc83d65afa1a3fa9abd43ddec9619746e2 /drivers/iio/accel
parentc288503b32e8c5534062a05ec565d28bffa06db3 (diff)
downloadlinux-7a1d0d91c94305fa5802a53df3a54c0ea1963c48.tar.bz2
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/accel')
-rw-r--r--drivers/iio/accel/bmc150-accel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/accel/bmc150-accel.c b/drivers/iio/accel/bmc150-accel.c
index 73e87739d219..bf827d012a71 100644
--- a/drivers/iio/accel/bmc150-accel.c
+++ b/drivers/iio/accel/bmc150-accel.c
@@ -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;