Skip to contentSkip to conversation

hwmon: (jc42) Drop of_match_ptr() protection

PATCH Applied Andy Shevchenko 2 participants 2 messages Nov 8, 2024 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (jc42) Drop of_match_ptr() protection

This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from the kernel. Hence drop from this driver.

Also switch of.h for mod_devicetable.h include given use of struct of_device_id which is defined in that header.

---
 drivers/hwmon/jc42.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/hwmon/jc42.c +2 -4
index c459dce496a6..06f0ab2f52fa 100644
@@ -11,6 +11,7 @@
 
 #include <linux/bitops.h>
 #include <linux/bitfield.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -19,7 +20,6 @@
 #include <linux/hwmon.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
-#include <linux/of.h>
 #include <linux/regmap.h>
 
 /* Addresses to scan */
@@ -595,20 +595,18 @@ static const struct i2c_device_id jc42_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, jc42_id);
 
-#ifdef CONFIG_OF
 static const struct of_device_id jc42_of_ids[] = {
 	{ .compatible = "jedec,jc-42.4-temp", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, jc42_of_ids);
-#endif
 
 static struct i2c_driver jc42_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "jc42",
 		.pm = JC42_DEV_PM_OPS,
-		.of_match_table = of_match_ptr(jc42_of_ids),
+		.of_match_table = jc42_of_ids,
 	},
 	.probe		= jc42_probe,
 	.remove		= jc42_remove,
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
maintainer Applied
#1 lore raw
Quoted 10 lines · Andy Shevchenko

This prevents use of this driver with ACPI via PRP0001 and is an example of an anti pattern I'm trying to remove from the kernel. Hence drop from this driver.

Also switch of.h for mod_devicetable.h include given use of struct of_device_id which is defined in that header.

Applied.

Thanks,
Guenter