Skip to contentSkip to conversation

hwmon: (lm75) Add explicit header include

PATCH Superseded Flaviu Nistor 4 participants 5 messages May 16 Hardware monitoring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (lm75) Add explicit header include

Since device_property_read_string() is used in the probe function add explicit include for linux/mod_devicetable.h and linux/property.h rather than having implicit inclusions.
Header linux/of.h can be removed and also of_match_ptr() improving non-Device Tree compatibility of the driver.

---
 drivers/hwmon/lm75.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/lm75.c +3 -2
index 845a0e09ea9f..32279049d44c 100644
@@ -14,7 +14,8 @@
 #include <linux/i3c/device.h>
 #include <linux/hwmon.h>
 #include <linux/err.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/util_macros.h>
 #include <linux/regulator/consumer.h>
@@ -1152,7 +1153,7 @@ static struct i2c_driver lm75_i2c_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "lm75",
-		.of_match_table = of_match_ptr(lm75_of_match),
+		.of_match_table = lm75_of_match,
 		.pm	= LM75_DEV_PM_OPS,
 	},
 	.probe		= lm75_i2c_probe,
Signature · 1 line
2.34.1
AI review Reviewed-by on v1 1/1
#1 lore raw
Reviewed-by: Sashiko <[email protected]>
Quoted 8 lines

Since device_property_read_string() is used in the probe function add explicit include for linux/mod_devicetable.h and linux/property.h rather than having implicit inclusions.
Header linux/of.h can be removed and also of_match_ptr() improving non-Device Tree compatibility of the driver.

#2 lore raw
Quoted 11 lines · On 16/05/2026 10:06, [email protected] wrote:
Quoted 8 lines

Since device_property_read_string() is used in the probe function add explicit include for linux/mod_devicetable.h and linux/property.h rather than having implicit inclusions.
Header linux/of.h can be removed and also of_match_ptr() improving non-Device Tree compatibility of the driver.

NAK, fake tag.

https://lore.kernel.org/r/[email protected]

Best regards,
Krzysztof

maintainer
#3 lore raw
Quoted 8 lines · Krzysztof Kozlowski
Quoted 7 lines · On 16/05/2026 10:06, [email protected] wrote:
Quoted 7 lines

Since device_property_read_string() is used in the probe function add explicit include for linux/mod_devicetable.h and linux/property.h rather than having implicit inclusions.
Header linux/of.h can be removed and also of_match_ptr() improving non-Device Tree compatibility of the driver.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

NAK, fake tag.

Until and unless there is an official policy that explicitly states that AI agents MUST NOT provide Reviewed-by: tags, I will ignore your NAKs on patches submitted in my scope of responsibility. Please point to the policy, not to your opinion about review feedback from AI agents.

Thanks,
Guenter

maintainer
#4 lore raw
In reply to Flaviu Nistor
Quoted 7 lines · Flaviu Nistor

Since device_property_read_string() is used in the probe function add explicit include for linux/mod_devicetable.h and linux/property.h rather than having implicit inclusions.
Header linux/of.h can be removed and also of_match_ptr() improving non-Device Tree compatibility of the driver.

Line breaks should be at column 75. There are way too many line breaks above.

Quoted 19 lines
---
 drivers/hwmon/lm75.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/lm75.c +2 -1
index 845a0e09ea9f..32279049d44c 100644
@@ -14,7 +14,8 @@
 #include <linux/i3c/device.h>
 #include <linux/hwmon.h>
 #include <linux/err.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/util_macros.h>
 #include <linux/regulator/consumer.h>

drivers/hwmon/lm75.c static struct i2c_driver lm75_i2c_driver = { · line 1156

Quoted 5 lines
drivers/hwmon/lm75.c +1 -1
@@ -1152,7 +1153,7 @@ static struct i2c_driver lm75_i2c_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "lm75",
-		.of_match_table = of_match_ptr(lm75_of_match),
+		.of_match_table = lm75_of_match,

With this, the __maybe_unused in the declaration of lm75_of_match is no longer necessary. Please drop.

Thanks,
Guenter