]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iio: adc: ad7923: Add of_device_id table
authorDaniel Junho <djunho@gmail.com>
Tue, 17 Dec 2019 11:11:57 +0000 (08:11 -0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 29 Dec 2019 15:20:03 +0000 (15:20 +0000)
Accomplish device tree compatibility to driver AD7923
by adding of_device_id table and making a subsequent call to
MODULE_DEVICE_TABLE.

Signed-off-by: Daniel Junho <djunho@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7923.c

index e535cec9fc02a5a3afbe9f8209086f71ecbfe5e3..6d56fa0b9e30a9c284caf7bfc1cfcfd7c58ad8cd 100644 (file)
@@ -348,9 +348,19 @@ static const struct spi_device_id ad7923_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, ad7923_id);
 
+static const struct of_device_id ad7923_of_match[] = {
+       { .compatible = "adi,ad7904", },
+       { .compatible = "adi,ad7914", },
+       { .compatible = "adi,ad7923", },
+       { .compatible = "adi,ad7924", },
+       { },
+};
+MODULE_DEVICE_TABLE(of, ad7923_of_match);
+
 static struct spi_driver ad7923_driver = {
        .driver = {
                .name   = "ad7923",
+               .of_match_table = ad7923_of_match,
        },
        .probe          = ad7923_probe,
        .remove         = ad7923_remove,