mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
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á <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20251015-dev-add-adt7422-v1-2-7cf72d3253ad@analog.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
d10b16d02c
commit
7b2a5a8469
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/regmap.h>
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user