]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
staging: iio: ad7746: add device tree support
authorJoão Seckler <joaoseckler@gmail.com>
Sat, 18 May 2019 22:27:33 +0000 (19:27 -0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 26 May 2019 17:48:14 +0000 (18:48 +0100)
Add a of_device_id struct variable and subsequent call to
MODULE_DEVICE_TABLE macro to support device tree.

Signed-off-by: João Seckler <joaoseckler@gmail.com>
Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Co-developed-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/cdc/ad7746.c

index 47610d863908b87fdf5662006f8f87ba68c9ada4..21527d84f9408cb737a6157e14d5c09c89f0731a 100644 (file)
@@ -748,9 +748,19 @@ static const struct i2c_device_id ad7746_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ad7746_id);
 
+static const struct of_device_id ad7746_of_match[] = {
+       { .compatible = "adi,ad7745" },
+       { .compatible = "adi,ad7746" },
+       { .compatible = "adi,ad7747" },
+       { },
+};
+
+MODULE_DEVICE_TABLE(of, ad7746_of_match);
+
 static struct i2c_driver ad7746_driver = {
        .driver = {
                .name = KBUILD_MODNAME,
+               .of_match_table = ad7746_of_match,
        },
        .probe = ad7746_probe,
        .id_table = ad7746_id,