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

staging: iio: adc: ad7192: removed spi_device_id

This patch removes spi_device_id table and moves the
init data (id of the chip) in the .data field
of of_device_id table.

Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Alexandru Tachici and committed by
Jonathan Cameron
66614ab2 893ac1a0

+11 -22
+11 -22
drivers/staging/iio/adc/ad7192.c
··· 16 16 #include <linux/err.h> 17 17 #include <linux/sched.h> 18 18 #include <linux/delay.h> 19 + #include <linux/of_device.h> 19 20 20 21 #include <linux/iio/iio.h> 21 22 #include <linux/iio/sysfs.h> ··· 877 876 return 0; 878 877 } 879 878 879 + static const struct of_device_id ad7192_of_match[] = { 880 + { .compatible = "adi,ad7190", .data = (void *)ID_AD7190 }, 881 + { .compatible = "adi,ad7192", .data = (void *)ID_AD7192 }, 882 + { .compatible = "adi,ad7193", .data = (void *)ID_AD7193 }, 883 + { .compatible = "adi,ad7195", .data = (void *)ID_AD7195 }, 884 + {} 885 + }; 886 + MODULE_DEVICE_TABLE(of, ad7192_of_match); 887 + 880 888 static int ad7192_probe(struct spi_device *spi) 881 889 { 882 890 struct ad7192_state *st; ··· 938 928 } 939 929 940 930 spi_set_drvdata(spi, indio_dev); 941 - st->devid = spi_get_device_id(spi)->driver_data; 931 + st->devid = (unsigned long)of_device_get_match_data(&spi->dev); 942 932 indio_dev->dev.parent = &spi->dev; 943 933 indio_dev->name = spi_get_device_id(spi)->name; 944 934 indio_dev->modes = INDIO_DIRECT_MODE; ··· 1019 1009 return 0; 1020 1010 } 1021 1011 1022 - static const struct spi_device_id ad7192_id[] = { 1023 - {"ad7190", ID_AD7190}, 1024 - {"ad7192", ID_AD7192}, 1025 - {"ad7193", ID_AD7193}, 1026 - {"ad7195", ID_AD7195}, 1027 - {} 1028 - }; 1029 - 1030 - MODULE_DEVICE_TABLE(spi, ad7192_id); 1031 - 1032 - static const struct of_device_id ad7192_of_match[] = { 1033 - { .compatible = "adi,ad7190" }, 1034 - { .compatible = "adi,ad7192" }, 1035 - { .compatible = "adi,ad7193" }, 1036 - { .compatible = "adi,ad7195" }, 1037 - {} 1038 - }; 1039 - 1040 - MODULE_DEVICE_TABLE(of, ad7192_of_match); 1041 - 1042 1012 static struct spi_driver ad7192_driver = { 1043 1013 .driver = { 1044 1014 .name = "ad7192", ··· 1026 1036 }, 1027 1037 .probe = ad7192_probe, 1028 1038 .remove = ad7192_remove, 1029 - .id_table = ad7192_id, 1030 1039 }; 1031 1040 module_spi_driver(ad7192_driver); 1032 1041