Re: [PATCH] hwmon: (tmp102) Change mode to read label property

From: Guenter Roeck

Date: Sat May 09 2026 - 07:39:17 EST


On 5/9/26 04:24, Flaviu Nistor wrote:
Replace of_property_read_string() with the preferred
device_property_read_string() in the probe function to
read the device label property, improving the driver
compatibility since this method is not limited to
Device Tree only.


The subject of this patch is completely off ...
"change mode" - what does this even mean ?

Signed-off-by: Flaviu Nistor <flaviu.nistor@xxxxxxxxx>
---
drivers/hwmon/tmp102.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c
index 3aa1a3fbeaa9..a89cc49798f5 100644
--- a/drivers/hwmon/tmp102.c
+++ b/drivers/hwmon/tmp102.c
@@ -313,7 +313,7 @@ static int tmp102_probe(struct i2c_client *client)
if (!tmp102)
return -ENOMEM;
- of_property_read_string(dev->of_node, "label", &tmp102->label);
+ device_property_read_string(dev, "label", &tmp102->label);

Changing this also requires changing include files.
Instead of including linux/of.h, you'll need to include
linux/mod_devicetable.h and linux/property.h.

Thanks,
Guenter