Merge branch 'for-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall...
[linux-2.6-microblaze.git] / drivers / mfd / da9052-i2c.c
index 47556d2..8de93db 100644 (file)
@@ -113,6 +113,7 @@ static const struct i2c_device_id da9052_i2c_id[] = {
        {"da9053-bc", DA9053_BC},
        {}
 };
+MODULE_DEVICE_TABLE(i2c, da9052_i2c_id);
 
 #ifdef CONFIG_OF
 static const struct of_device_id dialog_dt_ids[] = {
@@ -154,13 +155,8 @@ static int da9052_i2c_probe(struct i2c_client *client,
                return ret;
 
 #ifdef CONFIG_OF
-       if (!id) {
-               struct device_node *np = client->dev.of_node;
-               const struct of_device_id *deviceid;
-
-               deviceid = of_match_node(dialog_dt_ids, np);
-               id = deviceid->data;
-       }
+       if (!id)
+               id = of_device_get_match_data(&client->dev);
 #endif
 
        if (!id) {