Re: [PATCH 1/3] iio:accel:bmc150-accel: fix counting direction

Octavian Purdila
2015-06-16T10:31:10Z

On Tue, Jun 16, 2015 at 12:48 AM, Hartmut Knaack <knaack.h@gmx.de> wrote:
>
> 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>

> ---
> drivers/iio/accel/bmc150-accel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
> --
> 2.3.6
>