Re: [PATCH v1 2/2] hwmon: (pmbus) Add support for MPS Multi-phase mp5990

From: Guenter Roeck
Date: Mon Nov 06 2023 - 14:12:02 EST


On 11/6/23 00:02, PeterYin wrote:

[ ... ]
+
+static const struct of_device_id mp5990_of_match[] = {
+    { .compatible = "mps,mp5990" },
+    {}
+};
+
+static const struct i2c_device_id mp5990_id[] = {
+    {"mp5990", 0},
+    { }
+};
+MODULE_DEVICE_TABLE(i2c, mp5990_id);
+
+static struct i2c_driver mp5990_driver = {
+    .driver = {
+           .name = "mp5990",
+           .of_match_table = of_match_ptr(mp5990_of_match),

Using of_match_ptr() will result in a build failure if CONFIG_OF=n.

Should I use .of_match_table = mp5990_of_match, ?


Yes.

Thanks,
Guenter