[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAG=0Rq+UaWrZXnhfctYQobR_v6P8dtbZg2==rqFUP-qM+7UBEw@mail.gmail.com>
Date: Sun, 4 Aug 2024 19:20:50 +0530
From: Abhash jha <abhashkumarjha123@...il.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: anshulusr@...il.com, jic23@...nel.org, lars@...afoo.de,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 1/2] iio: light: ltr390: Add ALS channel and support
for gain and resolution
> Hi,
>
> >
> > +static int ltr390_set_mode(struct ltr390_data *data, enum ltr390_mode mode)
> > +{
> > + if (data->mode == mode)
> > + return 0;
> > +
> > + switch (mode) {
> > + case LTR390_SET_ALS_MODE:
> > + regmap_clear_bits(data->regmap, LTR390_MAIN_CTRL, LTR390_UVS_MODE);
>
> Should this be:
> ret = regmap_clear_bits();
> if (ret)
> return ret;
> ?
>
> Otherwise, 0 is returned in all cases and ltr390_read_raw() could be
> simplified.
>
> > + break;
> > +
> > + case LTR390_SET_UVS_MODE:
> > + regmap_set_bits(data->regmap, LTR390_MAIN_CTRL, LTR390_UVS_MODE);
>
> Same.
>
Yeah, I totally missed this. I will make the change and send a v7.
Thank you for pointing it out.
Powered by blists - more mailing lists