[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4GX23ZXUM4mvjgY@debian-BULLSEYE-live-builder-AMD64>
Date: Fri, 10 Jan 2025 18:57:47 -0300
From: Marcelo Schmitt <marcelo.schmitt1@...il.com>
To: Jonathan Santos <Jonathan.Santos@...log.com>
Cc: linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Sergiu Cuciurean <sergiu.cuciurean@...log.com>, lars@...afoo.de,
Michael.Hennerich@...log.com, jic23@...nel.org, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org
Subject: Re: [PATCH v1 06/15] iio: adc: ad7768-1: Update reg_read function
On 01/07, Jonathan Santos wrote:
> From: Sergiu Cuciurean <sergiu.cuciurean@...log.com>
>
> This patch adds an additional parameter to the register read function.
> By passing the data pointer to the function, the returned value will used
> only for status check.
> With this change, the status check won't be confused with a register value
> check:
>
> ret = ad7768_spi_reg_read()
> if (ret){}
>
> Also this change removes the probability to interpret a negative value as
> a return code (the ADC is a differential one)."
>
> Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@...log.com>
> ---
...
> @@ -190,7 +190,9 @@ static int ad7768_spi_reg_read(struct ad7768_state *st, unsigned int addr,
> if (ret < 0)
> return ret;
>
> - return (be32_to_cpu(st->data.d32) >> shift);
> + *data = (be32_to_cpu(st->data.d32) >> shift);
Are the outer parenthesis needed?
*data = be32_to_cpu(st->data.d32) >> shift;
?
> +
> + return ret;
> }
>
Powered by blists - more mailing lists