diff options
author | David Mosberger-Tang <davidm@egauge.net> | 2021-11-21 16:07:02 +0000 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2021-12-26 15:02:06 -0800 |
commit | 62cfc0576393e57a4c5622a08b6c4ba20fe5f880 (patch) | |
tree | e3c2927368dbf76012c79ff29f27cf5545eaf34d /drivers/hwmon/sht4x.c | |
parent | e380095b8018acd9f962a9020251c5d8f1191e49 (diff) |
hwmon: (sht4x) Add device tree match table
This patch enables automatic loading of the sht4x module via a device
tree table entry.
Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Link: https://lore.kernel.org/r/20211121160637.2312106-1-davidm@egauge.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/sht4x.c')
-rw-r--r-- | drivers/hwmon/sht4x.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/hwmon/sht4x.c b/drivers/hwmon/sht4x.c index 3415d7a0e0fc..c19df3ade48e 100644 --- a/drivers/hwmon/sht4x.c +++ b/drivers/hwmon/sht4x.c @@ -281,9 +281,16 @@ static const struct i2c_device_id sht4x_id[] = { }; MODULE_DEVICE_TABLE(i2c, sht4x_id); +static const struct of_device_id sht4x_of_match[] = { + { .compatible = "sensirion,sht4x" }, + { } +}; +MODULE_DEVICE_TABLE(of, sht4x_of_match); + static struct i2c_driver sht4x_driver = { .driver = { .name = "sht4x", + .of_match_table = sht4x_of_match, }, .probe = sht4x_probe, .id_table = sht4x_id, |