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

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: tsc2046: silent spi_device_id warning

Add spi_device_id to silent following kernel runtime warning:
"SPI driver tsc2046 has no spi_device_id for ti,tsc2046e-adc".

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220904100203.3614502-3-o.rempel@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Oleksij Rempel and committed by
Jonathan Cameron
3f8dd0a7 a616a6a1

+12
+12
drivers/iio/adc/ti-tsc2046.c
··· 805 805 } 806 806 807 807 dcfg = device_get_match_data(dev); 808 + if (!dcfg) { 809 + const struct spi_device_id *id = spi_get_device_id(spi); 810 + 811 + dcfg = (const struct tsc2046_adc_dcfg *)id->driver_data; 812 + } 808 813 if (!dcfg) 809 814 return -EINVAL; 810 815 ··· 891 886 }; 892 887 MODULE_DEVICE_TABLE(of, ads7950_of_table); 893 888 889 + static const struct spi_device_id tsc2046_adc_spi_ids[] = { 890 + { "tsc2046e-adc", (unsigned long)&tsc2046_adc_dcfg_tsc2046e }, 891 + { } 892 + }; 893 + MODULE_DEVICE_TABLE(spi, tsc2046_adc_spi_ids); 894 + 894 895 static struct spi_driver tsc2046_adc_driver = { 895 896 .driver = { 896 897 .name = "tsc2046", 897 898 .of_match_table = ads7950_of_table, 898 899 }, 900 + .id_table = tsc2046_adc_spi_ids, 899 901 .probe = tsc2046_adc_probe, 900 902 }; 901 903 module_spi_driver(tsc2046_adc_driver);