From: Nuno Sá Date: Wed, 15 Oct 2025 14:52:20 +0000 (+0100) Subject: hwmon: (adt7410): Add OF match table X-Git-Tag: v6.19-rc1~148^2~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b2a5a84694ea01e752411c24721d298cd07bc90;p=thirdparty%2Flinux.git hwmon: (adt7410): Add OF match table Add a struct of_device_id match table to the driver. While at it, make sure to properly include mod_devicetable.h which is also needed for struct i2c_device_id. Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20251015-dev-add-adt7422-v1-2-7cf72d3253ad@analog.com Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/adt7410.c b/drivers/hwmon/adt7410.c index 3bf0e0a0882c1..79952866a4db4 100644 --- a/drivers/hwmon/adt7410.c +++ b/drivers/hwmon/adt7410.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -94,10 +95,18 @@ static const struct i2c_device_id adt7410_ids[] = { }; MODULE_DEVICE_TABLE(i2c, adt7410_ids); +static const struct of_device_id adt7410_of_match[] = { + { .compatible = "adi,adt7410" }, + { .compatible = "adi,adt7420" }, + { } +}; +MODULE_DEVICE_TABLE(of, adt7410_of_match); + static struct i2c_driver adt7410_driver = { .driver = { .name = "adt7410", .pm = pm_sleep_ptr(&adt7x10_dev_pm_ops), + .of_match_table = adt7410_of_match, }, .probe = adt7410_i2c_probe, .id_table = adt7410_ids,