[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e9799164b92a5b2c270cd9a9d2af7eddd7ede83d.camel@gmail.com>
Date: Tue, 20 May 2025 10:24:16 +0100
From: Nuno Sá <noname.nuno@...il.com>
To: David Lechner <dlechner@...libre.com>, Antoniu Miclaus
<antoniu.miclaus@...log.com>, jic23@...nel.org, robh@...nel.org,
conor+dt@...nel.org, linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 09/10] iio: adc: ad4080: add driver support
On Mon, 2025-05-19 at 10:51 -0500, David Lechner wrote:
> 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@...log.com>
> > ---
>
>
> ...
>
> > +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.
I also find it more readable to check the return value and only validate when
needed. But this is pretty much a nit and personal taste.
Regarding your point, agree that the check should be better. Maybe Jonathan can
tweak or Antoniu can follow up on this?
- Nuno Sá
>
> > + return dev_err_probe(dev, -EINVAL,
> > + "Invalid 'adi,num-lanes' value: %u",
> > + st->num_lanes);
> > +
> > + return 0;
> > +}
> > +
Powered by blists - more mailing lists