hwmon: (ltc2945) Add devicetree match table
authorJonathan Cormier <jcormier@criticallink.com>
Thu, 26 Jan 2023 22:32:24 +0000 (17:32 -0500)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 3 Feb 2023 15:30:10 +0000 (07:30 -0800)
Add adi,ltc2945 compatible

Signed-off-by: Jonathan Cormier <jcormier@criticallink.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ltc2945.c

index 9adebb59f6042b1fc9ea9eae1166d4b02221393d..9af3e3821152b0899e230182eca9a205d5f2bf5f 100644 (file)
 #define CONTROL_MULT_SELECT    (1 << 0)
 #define CONTROL_TEST_MODE      (1 << 4)
 
+static const struct of_device_id __maybe_unused ltc2945_of_match[] = {
+       { .compatible = "adi,ltc2945" },
+       { }
+};
+MODULE_DEVICE_TABLE(of, ltc2945_of_match);
+
 static inline bool is_power_reg(u8 reg)
 {
        return reg < LTC2945_SENSE_H;
@@ -475,8 +481,9 @@ MODULE_DEVICE_TABLE(i2c, ltc2945_id);
 
 static struct i2c_driver ltc2945_driver = {
        .driver = {
-                  .name = "ltc2945",
-                  },
+               .name = "ltc2945",
+               .of_match_table = of_match_ptr(ltc2945_of_match),
+       },
        .probe_new = ltc2945_probe,
        .id_table = ltc2945_id,
 };