lkml.org 
[lkml]   [2021]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6 3/5] iio: adc: ad7949: add vref selection support
From
On Mon Aug 16, 2021 at 8:48 AM EDT, Andy Shevchenko wrote:
> On Mon, Aug 16, 2021 at 3:39 PM Liam Beguin <liambeguin@gmail.com>
> wrote:
> > On Mon Aug 16, 2021 at 4:04 AM EDT, Andy Shevchenko wrote:
> > > On Mon, Aug 16, 2021 at 12:35 AM Liam Beguin <liambeguin@gmail.com>
> > > wrote:
>
> ...
>
> > > > + tmp = 4096000;
> > > > + ret = device_property_read_u32(dev, "adi,internal-ref-microvolt", &tmp);
> > >
> > > > + if (ret < 0 && ret != -EINVAL) {
> >
> > Hi Andy,
> >
> > >
> > > What does this check (second part) is supposed to mean?
> > > The first part will make it mandatory, is it the goal?
> > >
> >
> > device_property_read_u32() will return -EINVAL if the property isn't
> > found in the devicetree.
> >
> > This checks for errors when the property is defined while keeping it
> > optional.
>
> Don't assign and don't check the error code of the API. As simply as
> that.

I'm not against getting rid of it, but I was asked to check for these
errors in earlier revisions of the patch.

Liam

>
> > > > + dev_err(dev, "invalid value for adi,internal-ref-microvolt\n");
> > > > + return ret;
> > > > + }
>
>
> --
> With Best Regards,
> Andy Shevchenko

\
 
 \ /
  Last update: 2021-08-16 15:43    [W:0.114 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site