mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] hwmon: (lm75) Add explicit header include
@ 2026-05-18  7:23 Flaviu Nistor
  2026-05-18 11:00 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Flaviu Nistor @ 2026-05-18  7:23 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Flaviu Nistor, linux-hwmon, linux-kernel

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>
---
Changes in v2:
- Remove __maybe_unuse and reduce line breaks suggested by Guenter Roeck.
- Link to v1: https://lore.kernel.org/all/20260516075708.6682-1-flaviu.nistor@gmail.com/

 drivers/hwmon/lm75.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 1e8af5805f2f..104149a03bad 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -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,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] hwmon: (lm75) Add explicit header include
  2026-05-18  7:23 [PATCH v2] hwmon: (lm75) Add explicit header include Flaviu Nistor
@ 2026-05-18 11:00 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2026-05-18 11:00 UTC (permalink / raw)
  To: Flaviu Nistor; +Cc: linux-hwmon, linux-kernel

On Mon, May 18, 2026 at 10:23:37AM +0300, Flaviu Nistor wrote:
> 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>

Applied.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-18 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-18  7:23 [PATCH v2] hwmon: (lm75) Add explicit header include Flaviu Nistor
2026-05-18 11:00 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®