Skip to content

Commit 27cad22

Browse files
committed
hwmon: (tmp108) Drop of_match_ptr() protection
Limiting the scope of devicetree support to CONFIG_OF prevents use of this driver with ACPI via PRP0001. Drop the dependency. While at it, - Switch of.h for mod_devicetable.h include given the use of struct of_device_id which is defined in that header - Add I2C device ID for p3t1085 - Drop the unnecessary include of hwmon-sysfs.h. Cc: Frank Li <Frank.Li@nxp.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20241204141754.4051186-1-linux@roeck-us.net Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent bddbb9c commit 27cad22

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/hwmon/tmp108.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
#include <linux/device.h>
99
#include <linux/err.h>
1010
#include <linux/hwmon.h>
11-
#include <linux/hwmon-sysfs.h>
11+
#include <linux/mod_devicetable.h>
1212
#include <linux/module.h>
1313
#include <linux/mutex.h>
14-
#include <linux/of.h>
1514
#include <linux/i2c.h>
1615
#include <linux/i3c/device.h>
1716
#include <linux/init.h>
@@ -422,25 +421,24 @@ static int tmp108_resume(struct device *dev)
422421
static DEFINE_SIMPLE_DEV_PM_OPS(tmp108_dev_pm_ops, tmp108_suspend, tmp108_resume);
423422

424423
static const struct i2c_device_id tmp108_i2c_ids[] = {
424+
{ "p3t1085" },
425425
{ "tmp108" },
426426
{ }
427427
};
428428
MODULE_DEVICE_TABLE(i2c, tmp108_i2c_ids);
429429

430-
#ifdef CONFIG_OF
431430
static const struct of_device_id tmp108_of_ids[] = {
432431
{ .compatible = "nxp,p3t1085", },
433432
{ .compatible = "ti,tmp108", },
434433
{}
435434
};
436435
MODULE_DEVICE_TABLE(of, tmp108_of_ids);
437-
#endif
438436

439437
static struct i2c_driver tmp108_driver = {
440438
.driver = {
441439
.name = DRIVER_NAME,
442440
.pm = pm_sleep_ptr(&tmp108_dev_pm_ops),
443-
.of_match_table = of_match_ptr(tmp108_of_ids),
441+
.of_match_table = tmp108_of_ids,
444442
},
445443
.probe = tmp108_probe,
446444
.id_table = tmp108_i2c_ids,

0 commit comments

Comments
 (0)