mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 22:51:35 +00:00
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>
This commit is contained in:
parent
c288503b32
commit
7a1d0d91c9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user