[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f40f39a5-3115-4eef-a660-59dcd07c973f@baylibre.com>
Date: Thu, 11 Sep 2025 14:14:17 -0500
From: David Lechner <dlechner@...libre.com>
To: Petre Rodan <petre.rodan@...dimension.ro>,
Jonathan Cameron <jic23@...nel.org>, Nuno Sá
<nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 07/14] iio: accel: bma220: reset registers during init
stage
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@...dimension.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;
> }
>
Powered by blists - more mailing lists