From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Eason Yang <j2anfernee@gmail.com>,
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,
olivier.moysan@foss.st.com, alisadariana@gmail.com,
tgamblin@baylibre.com, antoniu.miclaus@analog.com,
eblanc@baylibre.com, joao.goncalves@toradex.com,
ramona.gradinariu@analog.com, marcelo.schmitt@analog.com,
matteomartelli3@gmail.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 v7 2/2] iio: adc: add support for Nuvoton NCT7201
Date: Sat, 26 Apr 2025 15:17:38 +0100 [thread overview]
Message-ID: <20250426151738.43f0d25a@jic23-huawei> (raw)
In-Reply-To: <aAoU6iWGPkqjon7Z@smile.fi.intel.com>
>
> > + /* Enable Channel */
> > + if (chip->num_vin_channels <= 8) {
> > + err = regmap_write(chip->regmap, NCT7201_REG_CHANNEL_ENABLE,
> > + GENMASK(chip->num_vin_channels - 1, 0));
>
> > + if (err)
> > + return dev_err_probe(dev, err, "Failed to enable channel\n");
>
> This...
>
> > + } else {
> > + err = regmap_bulk_write(chip->regmap, NCT7201_REG_CHANNEL_ENABLE,
> > + &data, sizeof(data));
>
> > + if (err)
> > + return dev_err_probe(dev2, err, "Failed to enable channel\n");
>
> ...and this are identical, deduplicate by moving outside of if-else.
>
Not worth the dev vs dev2 distinction. They are ultimately the same device so
just use dev for both.
> > + }
>
>
prev parent reply other threads:[~2025-04-26 14:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 8:29 [PATCH v7 0/2] iio: adc: add Nuvoton NCT7201 ADC driver Eason Yang
2025-04-24 8:29 ` [PATCH v7 1/2] dt-bindings: iio: adc: add NCT7201 ADCs Eason Yang
2025-04-24 8:30 ` [PATCH v7 2/2] iio: adc: add support for Nuvoton NCT7201 Eason Yang
2025-04-24 10:39 ` Andy Shevchenko
2025-04-26 14:17 ` Jonathan Cameron [this message]
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=20250426151738.43f0d25a@jic23-huawei \
--to=jic23@kernel.org \
--cc=KWLIU@nuvoton.com \
--cc=alisadariana@gmail.com \
--cc=andriy.shevchenko@linux.intel.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=j2anfernee@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--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=matteomartelli3@gmail.com \
--cc=nuno.sa@analog.com \
--cc=olivier.moysan@foss.st.com \
--cc=ramona.gradinariu@analog.com \
--cc=robh@kernel.org \
--cc=tgamblin@baylibre.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