Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kim Seer Paller" <kimseer.paller@analog.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 4/4] iio: dac: ad3530r: add support for AD5710R/AD5711R
Date: Mon, 17 Aug 2026 06:52:22 +0000	[thread overview]
Message-ID: <20260817065222.9EA3E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817-iio-ad5710r-upstream-v3-4-3a4bf7b9c78b@analog.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Read-only `powerdown_mode` enum is exposed as writable in sysfs, returning -EINVAL on write.
--

--- Patch [4]: [PATCH v3 4/4] iio: dac: ad3530r: add support for AD5710R/AD5711R ---
commit 4d59cde2891949f47bb58dbf8c77908db02a7285
Author: Kim Seer Paller <kimseer.paller@analog.com>

iio: dac: ad3530r: add support for AD5710R/AD5711R

Adds support for the AD5710R/AD5711R 8-channel configurable IDAC/VDAC parts.
Each channel is configured as voltage or current output from its DT node,
with the powerdown mode derived from the channel's configured type.

> diff --git a/drivers/iio/dac/ad3530r.c b/drivers/iio/dac/ad3530r.c
> --- a/drivers/iio/dac/ad3530r.c
> +++ b/drivers/iio/dac/ad3530r.c
[ ... ]
> @@ -419,6 +511,17 @@ static const struct iio_chan_spec_ext_info ad3532r_ext_info[] = {
>  	{ }
>  };
>  
> +static const struct iio_chan_spec_ext_info ad5710r_ext_info[] = {
> +	{
> +		.name = "powerdown",
> +		.shared = IIO_SEPARATE,
> +		.read = ad5710r_get_dac_powerdown,
> +		.write = ad5710r_set_dac_powerdown,
> +	},
> +	IIO_ENUM("powerdown_mode", IIO_SEPARATE, &ad5710r_powerdown_mode_enum),

[Severity: Low]
The commit message mentions that the powerdown mode is read-only. Does using
the IIO_ENUM macro here inadvertently make the sysfs attribute writable?

The IIO_ENUM macro automatically populates both the .read and .write
callbacks (iio_enum_read and iio_enum_write). Since
ad5710r_powerdown_mode_enum lacks a .set callback, any writes from userspace
will safely fail and return -EINVAL.

Should this be manually defined as an iio_chan_spec_ext_info struct without
a .write callback to ensure the sysfs attribute is correctly exposed as
read-only?

> +	{ }
> +};
> +
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260817-iio-ad5710r-upstream-v3-0-3a4bf7b9c78b@analog.com?part=4

      reply	other threads:[~2026-08-17  6:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  6:37 [PATCH v3 0/4] Add support for AD5710R/AD5711R DAC Kim Seer Paller
2026-08-17  6:37 ` [PATCH v3 1/4] iio: ABI: Add DAC current powerdown attributes and 15kohm_to_gnd mode Kim Seer Paller
2026-08-17  6:43   ` sashiko-bot
2026-08-17  6:37 ` [PATCH v3 2/4] dt-bindings: iio: dac: add adi,ad5710r.yaml Kim Seer Paller
2026-08-17  6:45   ` sashiko-bot
2026-08-17  6:37 ` [PATCH v3 3/4] iio: dac: ad3530r: parameterize DAC resolution Kim Seer Paller
2026-08-17  6:37 ` [PATCH v3 4/4] iio: dac: ad3530r: add support for AD5710R/AD5711R Kim Seer Paller
2026-08-17  6:52   ` sashiko-bot [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=20260817065222.9EA3E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kimseer.paller@analog.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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