Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: iio: ad7746: add device tree support

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>

authored by

João Seckler and committed by
Jonathan Cameron
094c52db ed83144e

+10
+10
drivers/staging/iio/cdc/ad7746.c
··· 748 748 749 749 MODULE_DEVICE_TABLE(i2c, ad7746_id); 750 750 751 + static const struct of_device_id ad7746_of_match[] = { 752 + { .compatible = "adi,ad7745" }, 753 + { .compatible = "adi,ad7746" }, 754 + { .compatible = "adi,ad7747" }, 755 + { }, 756 + }; 757 + 758 + MODULE_DEVICE_TABLE(of, ad7746_of_match); 759 + 751 760 static struct i2c_driver ad7746_driver = { 752 761 .driver = { 753 762 .name = KBUILD_MODNAME, 763 + .of_match_table = ad7746_of_match, 754 764 }, 755 765 .probe = ad7746_probe, 756 766 .id_table = ad7746_id,