staging: iio: ad5933: add device tree support
authorMarcelo Schmitt <marcelo.schmitt1@gmail.com>
Sat, 24 Nov 2018 13:18:57 +0000 (11:18 -0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 25 Nov 2018 09:58:08 +0000 (09:58 +0000)
Add a of_device_id struct variable and subsequent call to
MODULE_DEVICE_TABLE macro to complete device tree support.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/impedance-analyzer/ad5933.c

index f9bcb8310e21bb846f364dfc4d4168aa19a1437a..9e52384f5370c6f25d11ecac901086422b93e0f2 100644 (file)
@@ -786,9 +786,18 @@ static const struct i2c_device_id ad5933_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ad5933_id);
 
+static const struct of_device_id ad5933_of_match[] = {
+       { .compatible = "adi,ad5933" },
+       { .compatible = "adi,ad5934" },
+       { },
+};
+
+MODULE_DEVICE_TABLE(of, ad5933_of_match);
+
 static struct i2c_driver ad5933_driver = {
        .driver = {
                .name = "ad5933",
+               .of_match_table = ad5933_of_match,
        },
        .probe = ad5933_probe,
        .remove = ad5933_remove,