From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
robh@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org,
linux-iio@vger.kernel.org, s32@nxp.com,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
chester62515@gmail.com, mbrugger@suse.com,
ghennadi.procopciuc@oss.nxp.com
Subject: Re: [PATCH v4 2/2] iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms
Date: Wed, 15 Oct 2025 19:43:54 +0300 [thread overview]
Message-ID: <aO_PSisFmsYb84r0@smile.fi.intel.com> (raw)
In-Reply-To: <0ac22118-fd0f-49c0-9aa8-5739925587d2@linaro.org>
On Wed, Oct 15, 2025 at 09:17:40AM +0200, Daniel Lezcano wrote:
> On 9/20/25 11:27, Jonathan Cameron wrote:
[ ... ]
> ceocfr = readl(NXP_SAR_ADC_CEOCFR0(info->regs));
> - if (!(ceocfr & NXP_SAR_ADC_EOC_CH(chan)))
> +
> + /* FIELD_GET() can not be used here because EOC_CH is not constant
> */
> + if (!(NXP_SAR_ADC_EOC_CH(chan) & ceocfr))
> return -EIO;
Make field_get() public in bitfield.h and use it. We have a handful copies
already which deserves someone actually does that for all.
> cdr = readl(NXP_SAR_ADC_CDR(info->regs, chan));
> - if (!(cdr & NXP_SAR_ADC_CDR_VALID))
> + if (!(FIELD_GET(NXP_SAR_ADC_CDR_VALID, cdr)))
> return -EIO;
>
> - return cdr & NXP_SAR_ADC_CDR_CDATA_MASK;
> + return FIELD_GET(NXP_SAR_ADC_CDR_CDATA_MASK, cdr);
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-10-18 17:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 13:56 [PATCH v4 0/2] NXP SAR ADC IIO driver for s32g2/3 platforms Daniel Lezcano
2025-09-19 13:56 ` [PATCH v4 1/2] dt-bindings: iio: adc: Add the NXP SAR ADC " Daniel Lezcano
2025-09-19 13:56 ` [PATCH v4 2/2] iio: adc: Add the NXP SAR ADC support for the " Daniel Lezcano
2025-09-20 9:27 ` Jonathan Cameron
2025-10-15 7:17 ` Daniel Lezcano
2025-10-15 16:43 ` Andy Shevchenko [this message]
2025-10-18 13:01 ` Jonathan Cameron
2025-10-17 9:01 ` Daniel Lezcano
2025-10-18 13:02 ` Jonathan Cameron
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=aO_PSisFmsYb84r0@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=chester62515@gmail.com \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=ghennadi.procopciuc@oss.nxp.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbrugger@suse.com \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=s32@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.