summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-06-15 23:48:24 +0200
committerJonathan Cameron <jic23@kernel.org>2015-07-19 11:48:09 +0100
commitc13c9da6d86fa9cb6449deb6c71b18ffcf32ae53 (patch)
treea3b0aa1b107e4c1bacdb89a8214731960799aa84 /drivers/iio
parentbd7bd0cc3a60e082b17a4f64ce76831aa1c6dffe (diff)
downloadop-kernel-dev-c13c9da6d86fa9cb6449deb6c71b18ffcf32ae53.zip
op-kernel-dev-c13c9da6d86fa9cb6449deb6c71b18ffcf32ae53.tar.gz
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.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 4e70f51..cc5a357 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;
OpenPOWER on IntegriCloud