Re: [PATCH v4 1/2] dt-bindings: hwmon: Add Eswin EIC7700 PVT sensor

From: Guenter Roeck

Date: Tue May 12 2026 - 11:07:40 EST


On 5/12/26 02:16, Huan He wrote:
Hi Krzysztof,

Thank you very much for your detailed review. We appreciate the feedback.

On Thu, Apr 30, 2026 at 02:44:44PM +0800, hehuan1@xxxxxxxxxxxxxxxxxx wrote:
+
+ label:
+ enum:
+ - pvt0
+ - pvt1

No, label is user-visible name. Can be whatever user decides.

Please read writing bindings - instance IDs are not allowed.

Thanks for the clarification.
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);


This would try to register a free-text name for the hwmon device,
which would be unacceptable.

There are lots of multi-channel devices out there. None of them
have those problems. Why do you insist in free-text names instead of
using, say, "reg" to distinguish the channels ?

Guenter


+
+ resets:
+ maxItems: 1
+
+ '#thermal-sensor-cells':
+ const: 0
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - interrupts
+ - label
+ - resets
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ pvt@50b00000 {


Node names should be generic. See also an explanation and list of
examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
If you cannot find a name matching your device, please check in kernel
sources for similar cases or you can grow the spec (via pull request to
DT spec repo).

I will update the example node name from "pvt@..." to the generic
"sensor@...". Is this acceptable?

Best regards,
Huan He