]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (lm75) Add explicit header include
authorFlaviu Nistor <flaviu.nistor@gmail.com>
Mon, 18 May 2026 07:23:37 +0000 (10:23 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 9 Jun 2026 15:23:00 +0000 (08:23 -0700)
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.
Remove __maybe_unuse because it is not needed anymore.

Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>
Link: https://lore.kernel.org/r/20260518072337.4918-1-flaviu.nistor@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm75.c

index 1e8af5805f2f5a8f63b68592273e467af9748ec3..104149a03bad037459e918fb12ced9527ded2c7c 100644 (file)
@@ -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>
@@ -899,7 +900,7 @@ static int lm75_i3c_probe(struct i3c_device *i3cdev)
        return lm75_generic_probe(dev, id_data->name, id_data->type, 0, regmap);
 }
 
-static const struct of_device_id __maybe_unused lm75_of_match[] = {
+static const struct of_device_id lm75_of_match[] = {
        {
                .compatible = "adi,adt75",
                .data = (void *)adt75
@@ -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,