Re: [PATCH v6 09/10] iio: adc: ad4080: add driver support
From: David Lechner
Date: Mon May 19 2025 - 11:52:34 EST
On 5/16/25 3:26 AM, Antoniu Miclaus wrote:
> Add support for AD4080 high-speed, low noise, low distortion,
> 20-bit, Easy Drive, successive approximation register (SAR)
> analog-to-digital converter (ADC).
>
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx>
> ---
...
> +static int ad4080_properties_parse(struct ad4080_state *st)
> +{
> + struct device *dev = regmap_get_device(st->regmap);
> +
> + st->lvds_cnv_en = device_property_read_bool(dev, "adi,lvds-cnv-enable");
> +
> + st->num_lanes = 1;
> + device_property_read_u32(dev, "adi,num-lanes", &st->num_lanes);
> + if (!st->num_lanes)
Error checking seems not strict enough. Allowed values are only 1 and 2.
> + return dev_err_probe(dev, -EINVAL,
> + "Invalid 'adi,num-lanes' value: %u",
> + st->num_lanes);
> +
> + return 0;
> +}
> +