summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKory Maincent <kory.maincent@bootlin.com>2026-06-08 17:23:43 +0200
committerGuenter Roeck <linux@roeck-us.net>2026-06-09 08:23:18 -0700
commitcd1b42617aafe01810ab7d3b9948d2f5fa9fb8af (patch)
tree9e8503772207ab2f63813916414f3ea14167822e
parent5f6617089dc06f9941e8ca57ba64345c9f1ed9ed (diff)
downloadlinux-next-cd1b42617aafe01810ab7d3b9948d2f5fa9fb8af.tar.gz
linux-next-cd1b42617aafe01810ab7d3b9948d2f5fa9fb8af.zip
hwmon: (adt7462) Add of_match_table to support devicetree
Add of_match_table to add support of devicetree probing. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> [rgantois: Removed of_match_ptr().] Signed-off-by: Romain Gantois <romain.gantois@bootlin.com> Link: https://lore.kernel.org/r/20260608-adt7462-bindings-v2-1-272982c40325@bootlin.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/adt7462.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c
index 5101d30ed9c6..31cf9e3bb04f 100644
--- a/drivers/hwmon/adt7462.c
+++ b/drivers/hwmon/adt7462.c
@@ -12,6 +12,7 @@
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
+#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
#include <linux/log2.h>
#include <linux/slab.h>
@@ -1814,10 +1815,17 @@ static const struct i2c_device_id adt7462_id[] = {
};
MODULE_DEVICE_TABLE(i2c, adt7462_id);
+static const struct of_device_id adt7462_of_match[] = {
+ { .compatible = "onnn,adt7462" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, adt7462_of_match);
+
static struct i2c_driver adt7462_driver = {
.class = I2C_CLASS_HWMON,
.driver = {
.name = "adt7462",
+ .of_match_table = adt7462_of_match,
},
.probe = adt7462_probe,
.id_table = adt7462_id,