[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b24ec167ebef4947eb9fe122d546ea8410bc6c2.camel@gmail.com>
Date: Tue, 20 May 2025 15:09:25 +0100
From: Nuno Sá <noname.nuno@...il.com>
To: Antoniu Miclaus <antoniu.miclaus@...log.com>, jic23@...nel.org,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] iio: adc: ad4080: extend check for data lanes num
On Tue, 2025-05-20 at 14:01 +0300, Antoniu Miclaus wrote:
> Extend the check for st->num_lanes to ensure it is not greater
> than 2, preventing invalid configurations.
>
> The AD4080 only supports up to 2 data lanes.
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@...log.com>
> ---
Reviewed-by: Nuno Sá <nuno.sa@...log.com>
> drivers/iio/adc/ad4080.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c
> index c36eb41d738a..6e61787ed321 100644
> --- a/drivers/iio/adc/ad4080.c
> +++ b/drivers/iio/adc/ad4080.c
> @@ -516,7 +516,7 @@ static int ad4080_properties_parse(struct ad4080_state
> *st)
>
> st->num_lanes = 1;
> device_property_read_u32(dev, "adi,num-lanes", &st->num_lanes);
> - if (!st->num_lanes)
> + if (!st->num_lanes || st->num_lanes > 2)
> return dev_err_probe(dev, -EINVAL,
> "Invalid 'adi,num-lanes' value: %u",
> st->num_lanes);
Powered by blists - more mailing lists