Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Yu-Hsian Yang <j2anfernee@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	jic23@kernel.org, lars@metafoo.de, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, dlechner@baylibre.com,
	nuno.sa@analog.com, javier.carrasco.cruz@gmail.com,
	gstols@baylibre.com, alisadariana@gmail.com,
	tgamblin@baylibre.com, olivier.moysan@foss.st.com,
	antoniu.miclaus@analog.com, eblanc@baylibre.com,
	joao.goncalves@toradex.com, tobias.sperling@softing.com,
	marcelo.schmitt@analog.com,
	angelogioacchino.delregno@collabora.com,
	thomas.bonnefille@bootlin.com, herve.codina@bootlin.com,
	chanh@os.amperecomputing.com, KWLIU@nuvoton.com,
	yhyang2@nuvoton.com, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] iio: adc: add support for Nuvoton NCT7201
Date: Sun, 20 Apr 2025 22:45:10 +0300	[thread overview]
Message-ID: <aAVOxhe_VAvMXWRQ@surfacebook.localdomain> (raw)
In-Reply-To: <CA+4VgcKfDo2NSeBA6+z5AqCeEBds0-DwC0-e3H-bkJ7hEcHaWw@mail.gmail.com>

Sun, Apr 20, 2025 at 09:03:05PM +0800, Yu-Hsian Yang kirjoitti:
> Andy Shevchenko <andriy.shevchenko@linux.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



  reply	other threads:[~2025-04-20 19:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16  8:17 [PATCH v6 0/2] iio: adc: add Nuvoton NCT7201 ADC driver Eason Yang
2025-04-16  8:17 ` [PATCH v6 1/2] dt-bindings: iio: adc: add NCT7201 ADCs Eason Yang
2025-04-17  6:20   ` Krzysztof Kozlowski
2025-04-16  8:17 ` [PATCH v6 2/2] iio: adc: add support for Nuvoton NCT7201 Eason Yang
2025-04-16  9:34   ` Andy Shevchenko
2025-04-20 13:03     ` Yu-Hsian Yang
2025-04-20 19:45       ` Andy Shevchenko [this message]
2025-04-18 16:13   ` Jonathan Cameron
2025-04-19 15:23     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aAVOxhe_VAvMXWRQ@surfacebook.localdomain \
    --to=andy.shevchenko@gmail.com \
    --cc=KWLIU@nuvoton.com \
    --cc=alisadariana@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=antoniu.miclaus@analog.com \
    --cc=chanh@os.amperecomputing.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=eblanc@baylibre.com \
    --cc=gstols@baylibre.com \
    --cc=herve.codina@bootlin.com \
    --cc=j2anfernee@gmail.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jic23@kernel.org \
    --cc=joao.goncalves@toradex.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=robh@kernel.org \
    --cc=tgamblin@baylibre.com \
    --cc=thomas.bonnefille@bootlin.com \
    --cc=tobias.sperling@softing.com \
    --cc=yhyang2@nuvoton.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox