[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250520110101.29478-2-antoniu.miclaus@analog.com>
Date: Tue, 20 May 2025 14:01:01 +0300
From: Antoniu Miclaus <antoniu.miclaus@...log.com>
To: <jic23@...nel.org>, <linux-iio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: Antoniu Miclaus <antoniu.miclaus@...log.com>
Subject: [PATCH 2/2] iio: adc: ad4080: extend check for data lanes num
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>
---
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);
--
2.49.0
Powered by blists - more mailing lists