hwmon: (adt7475) Add explicit header include
Subsystems (2)
PATCH 1/1 hwmon: (adt7475) Add explicit header include
Since device_property_read_string() and similar functions defined in linux/property.h are used in the driver add explicit include for linux/mod_devicetable.h and linux/property.h rather than having implicit inclusions.
Removed of_match_ptr() improving non-Device Tree compatibility of the driver and drop unnecessary __maybe_unused.
Header linux/of.h can't be removed yet since macro is_of_node() is used.
--- drivers/hwmon/adt7475.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/adt7475.c +4 -2
@@ -19,6 +19,8 @@#include <linux/err.h> #include <linux/jiffies.h> #include <linux/of.h> +#include <linux/mod_devicetable.h> +#include <linux/property.h> #include <linux/util_macros.h> #include <dt-bindings/pwm/pwm.h>
@@ -173,7 +175,7 @@ static const struct i2c_device_id adt7475_id[] = { };MODULE_DEVICE_TABLE (i2c, adt7475_id); -static const struct of_device_id __maybe_unused adt7475_of_match[] = { +static const struct of_device_id adt7475_of_match[] = { { .compatible ="adi,adt7473" , .data = (void *)adt7473
@@ -1995,7 +1997,7 @@ static struct i2c_driver adt7475_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "adt7475", - .of_match_table = of_match_ptr(adt7475_of_match), + .of_match_table = adt7475_of_match, }, .probe = adt7475_probe, .id_table = adt7475_id,
Signature · 1 line
2.34.1
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines
Since
device_property_read_string()and similar functions defined inlinux/property.hare used in the driver add explicit include forlinux/mod_devicetable.handlinux/property.hrather than having implicit inclusions.
Removedof_match_ptr()improving non-Device Tree compatibility of the driver and drop unnecessary__maybe_unused.
Headerlinux/of.hcan't be removed yet since macrois_of_node()is used.Signed-off-by Flaviu Nistor <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 9 lines · Flaviu Nistor
Since
device_property_read_string()and similar functions defined inlinux/property.hare used in the driver add explicit include forlinux/mod_devicetable.handlinux/property.hrather than having implicit inclusions.
Removedof_match_ptr()improving non-Device Tree compatibility of the driver and drop unnecessary__maybe_unused.
Headerlinux/of.hcan't be removed yet since macrois_of_node()is used.Signed-off-by Flaviu Nistor <[email protected]>
Applied.
For the future, please don't split lines that much in patch descriptions. The column length limit in patch descriptions is 75.
Thanks,
Guenter
Quoted 35 lines
--- drivers/hwmon/adt7475.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/hwmon/adt7475.c +4
-2@@ -19,6 +19,8 @@#include <linux/err.h> #include <linux/jiffies.h> #include <linux/of.h> +#include <linux/mod_devicetable.h> +#include <linux/property.h> #include <linux/util_macros.h> #include <dt-bindings/pwm/pwm.h> @@ -173,7 +175,7 @@ static const struct i2c_device_id adt7475_id[] = { };MODULE_DEVICE_TABLE (i2c, adt7475_id); -static const struct of_device_id __maybe_unused adt7475_of_match[] = { +static const struct of_device_id adt7475_of_match[] = { { .compatible ="adi,adt7473" , .data = (void *)adt7473@@ -1995,7 +1997,7 @@ static struct i2c_driver adt7475_driver = { .class = I2C_CLASS_HWMON, .driver = { .name = "adt7475", - .of_match_table = of_match_ptr(adt7475_of_match), + .of_match_table = adt7475_of_match, }, .probe = adt7475_probe, .id_table = adt7475_id,