Re: [PATCH v5 2/2] iio: adc: add support for Nuvoton NCT7201
From: Andy Shevchenko
Date: Tue Apr 15 2025 - 04:30:48 EST
On Mon, Apr 14, 2025 at 09:40:35PM +0800, Yu-Hsian Yang wrote:
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> 於 2025年4月10日 週四 上午12:19寫道:
> > On Wed, Apr 09, 2025 at 09:23:51AM +0800, Eason Yang wrote:
...
> > Here and elsewhere why ' < 0' is used? Do you expect positive return values
> > from those?
>
> In regmap_read function, A value of zero will be returned on success,
> a negative errno will be returned in error cases.
> We don't have a positive return case.
So, can we remove ' < 0' parts where they are not required, please?
...
> > > + chip->client = client;
> >
> > How exactly is _client_ used elsewhere? Shouldn't it be just a struct device
> > pointer?
>
> Yes, it is just a struct device pointer.
> In nct7201_init_chip(chip), we would use the chip->client->dev as
> dev_err_probe() parameter
Just save there struct device *dev and use chip->dev instead.
--
With Best Regards,
Andy Shevchenko