Re: [PATCH v2 07/14] iio: accel: bma220: reset registers during init stage

David Lechner
2025-09-11T19:14:19Z

On 9/10/25 2:57 AM, Petre Rodan wrote:
> Bring all configuration registers to default values during device probe().
>
> Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
> ---

...

> static int bma220_power(struct spi_device *spi, bool up)
> @@ -244,16 +244,43 @@ static int bma220_power(struct spi_device *spi, bool up)
> if (ret < 0)
> return ret;
>
> - if (up && ret == BMA220_SUSPEND_SLEEP)
> + if (up && (ret == BMA220_SUSPEND_SLEEP))

Over 80% of existing kernel code doesn't have the unnecessary ()
on similar expressions so I think we should leave it that way.

(just seems like adding noise to me)

> return 0;
>
> - if (!up && ret == BMA220_SUSPEND_WAKE)
> + if (!up && (ret == BMA220_SUSPEND_WAKE))
> return 0;
> }
>
> return -EBUSY;
> }
>