From: "Huan He" <hehuan1@eswincomputing.com>
To: sashiko@lists.linux.dev
Cc: linux-hwmon@vger.kernel.org
Subject: Re: Re: [PATCH v4 1/2] dt-bindings: hwmon: Add Eswin EIC7700 PVT sensor
Date: Tue, 12 May 2026 17:14:03 +0800 (GMT+08:00) [thread overview]
Message-ID: <75446e0c.6167.19e1b76fe55.Coremail.hehuan1@eswincomputing.com> (raw)
In-Reply-To: <20260430070049.0B702C2BCB4@smtp.kernel.org>
Hi Sashiko,
Thank you very much for your detailed review. We appreciate the feedback.
>
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Medium] The 'label' property is required and restricted to an enum, misusing it for hardware instance identification.
> - [Medium] The '#thermal-sensor-cells' property is defined but omitted from the 'required' list.
> --
>
> commit 5a5ed34d17ea4e88cd80b5a8e96e21dcc65e9f11
> Author: Huan He <hehuan1@eswincomputing.com>
>
> dt-bindings: hwmon: Add Eswin EIC7700 PVT sensor
>
> This commit adds the device tree binding documentation for the Eswin
> EIC7700 Process, Voltage and Temperature sensor. The SoC integrates two
> PVT instances for monitoring the main SoC and DDR power domains.
>
> > diff --git a/Documentation/devicetree/bindings/hwmon/eswin,eic7700-pvt.yaml b/Documentation/devicetree/bindings/hwmon/eswin,eic7700-pvt.yaml
> > new file mode 100644
> > index 0000000000000..ba89b829ee947
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/hwmon/eswin,eic7700-pvt.yaml
>
> [ ... ]
>
> > + interrupts:
> > + maxItems: 1
> > +
> > + label:
> > + enum:
> > + - pvt0
> > + - pvt1
>
> Is it appropriate to restrict the standard label property to a strict enum
> and require it?
>
> The devicetree specification generally defines label as an optional,
> human-readable string. Should the hardware instances be differentiated by
> their reg addresses, aliases, or dedicated properties instead of imposing
> a strict enum on a standard free-form string?
I am planning to update the next revision as follows. Would this be
acceptable?
YAML:
- label:
- enum:
- - pvt0
- - pvt1
+ label: true
required:
- compatible
- reg
- clocks
- interrupts
- - label
Driver:
static int eic7700_pvt_create_hwmon(struct pvt_hwmon *pvt)
{
- struct device *dev = pvt->dev;
- struct device_node *np = dev->of_node;
- const char *node_label;
- int type;
- const char *names[2] = {"soc_pvt", "ddr_pvt"};
-
- if (of_property_read_string(np, "label", &node_label)) {
- dev_err(dev, "Missing 'label' property in DTS node\n");
- return -EINVAL;
- }
-
- if (strcmp(node_label, "pvt0") == 0) {
- type = 0;
- } else if (strcmp(node_label, "pvt1") == 0) {
- type = 1;
- } else {
- dev_err(pvt->dev, "Unsupported label: %s\n", node_label);
- return -EINVAL;
- }
+ const char *name = "pvt";
+
+ of_property_read_string(pvt->dev->of_node, "label", &name);
- pvt->hwmon = devm_hwmon_device_register_with_info(pvt->dev, names[type],
+ pvt->hwmon = devm_hwmon_device_register_with_info(pvt->dev, name,
pvt, &pvt_hwmon_info,
NULL);
>
> > +
> > + resets:
> > + maxItems: 1
> > +
> > + '#thermal-sensor-cells':
> > + const: 0
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - clocks
> > + - interrupts
> > + - label
> > + - resets
>
> Should #thermal-sensor-cells be included in this required list?
>
> Since the device acts as a thermal sensor provider, omitting its cell-count
> property allows incomplete device tree nodes to silently pass schema
> validation. This might lead to runtime failures or misconfigurations when
> dependent thermal zones attempt to reference the sensor.
I will add "#thermal-sensor-cells" to the required list in the next
revision.
Best regards,
Huan He
next prev parent reply other threads:[~2026-05-12 9:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 6:41 [PATCH v4 0/2] Add driver support for ESWIN EIC7700 PVT controller hehuan1
2026-04-30 6:44 ` [PATCH v4 1/2] dt-bindings: hwmon: Add Eswin EIC7700 PVT sensor hehuan1
2026-04-30 7:00 ` sashiko-bot
2026-05-12 9:14 ` Huan He [this message]
2026-05-03 12:03 ` Krzysztof Kozlowski
2026-05-12 9:16 ` Huan He
2026-05-12 14:26 ` Guenter Roeck
2026-04-30 6:45 ` [PATCH v4 2/2] hwmon: Add Eswin EIC7700 PVT sensor driver hehuan1
2026-04-30 8:08 ` sashiko-bot
2026-05-12 9:45 ` Huan He
2026-05-12 9:51 ` Huan He
2026-04-30 20:24 ` [PATCH v4 0/2] Add driver support for ESWIN EIC7700 PVT controller Guenter Roeck
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=75446e0c.6167.19e1b76fe55.Coremail.hehuan1@eswincomputing.com \
--to=hehuan1@eswincomputing.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=sashiko@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