[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aAVOxhe_VAvMXWRQ@surfacebook.localdomain>
Date: Sun, 20 Apr 2025 22:45:10 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Yu-Hsian Yang <j2anfernee@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, jic23@...nel.org,
lars@...afoo.de, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, dlechner@...libre.com, nuno.sa@...log.com,
javier.carrasco.cruz@...il.com, gstols@...libre.com,
alisadariana@...il.com, tgamblin@...libre.com,
olivier.moysan@...s.st.com, antoniu.miclaus@...log.com,
eblanc@...libre.com, joao.goncalves@...adex.com,
tobias.sperling@...ting.com, marcelo.schmitt@...log.com,
angelogioacchino.delregno@...labora.com,
thomas.bonnefille@...tlin.com, herve.codina@...tlin.com,
chanh@...amperecomputing.com, KWLIU@...oton.com,
yhyang2@...oton.com, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 2/2] iio: adc: add support for Nuvoton NCT7201
Sun, Apr 20, 2025 at 09:03:05PM +0800, Yu-Hsian Yang kirjoitti:
> Andy Shevchenko <andriy.shevchenko@...ux.intel.com> 於 2025年4月16日 週三 下午5:34寫道:
> > On Wed, Apr 16, 2025 at 04:17:34PM +0800, Eason Yang wrote:
...
> > > +#define NCT7201_REG_VIN(i) (i)
> >
> > This doesn't do anything useful. Why do you need this rather useless macro?
> >
>
> Actually here we should define NCT7201_REG_VIN(i) as (0x00 + i),
> We simply it as (i).
Please, don't. Use the full form which makes a big difference to the perception
of this macro.
...
> > > +struct nct7201_chip_info {
> > > + struct device *dev;
> >
> > This can be derived from the respective regmap. No need to have it here.
> >
> > > + struct regmap *regmap;
> > > + struct regmap *regmap16;
> > > + int num_vin_channels;
> > > + u16 vin_mask;
> > > +};
>
> Use regmap->dev is okay if use regmap API.
No, you are not supposed to use regmap->dev (and you can't), you need to call a
getter API and get the device pointer.
> But if we need to print message not from regmap API,
I don't get this. What do you mean? The example you showed prints a message for
the device. The same device that was used to create a regmap.
> how suggestions to do in this case?
Use the one that you can retrieve from regmap.
...
So, you have commented on some with agreement, and left uncommented a lot. Does
it mean you are agree on all points? The rule of thumb do not comment on the cases
you are fully agree with. Current email just makes a confusion.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists