diff options
author | Wei Yongjun <[email protected]> | 2022-09-21 16:36:18 +0000 |
---|---|---|
committer | Jonathan Cameron <[email protected]> | 2022-11-23 19:43:57 +0000 |
commit | 283026528e0ee8ea89a60f9addaf0f2eda167c42 (patch) | |
tree | 28700608171b7e05e04da1d9cdedae001f84d68a | |
parent | 35dab731c4d2b1e71827a56826ef60f53e97fc32 (diff) |
iio: adc: ad9467: Silence no spi_device_id warnings
SPI devices use the spi_device_id for module autoloading even on
systems using device tree, after commit 5fa6863ba692 ("spi: Check
we have a spi_device_id for each DT compatible"), kernel warns as
follows since the spi_device_id is missing:
SPI driver ad9467 has no spi_device_id for adi,ad9265
SPI driver ad9467 has no spi_device_id for adi,ad9434
Add spi_device_id entries to silence the warnings, and ensure driver
module autoloading works.
Signed-off-by: Wei Yongjun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
-rw-r--r-- | drivers/iio/adc/ad9467.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c index 7534572f7475..0621cf59d614 100644 --- a/drivers/iio/adc/ad9467.c +++ b/drivers/iio/adc/ad9467.c @@ -388,6 +388,8 @@ static int ad9467_probe(struct spi_device *spi) info = of_device_get_match_data(&spi->dev); if (!info) + info = (void *)spi_get_device_id(spi)->driver_data; + if (!info) return -ENODEV; conv = devm_adi_axi_adc_conv_register(&spi->dev, sizeof(*st)); @@ -447,12 +449,21 @@ static const struct of_device_id ad9467_of_match[] = { }; MODULE_DEVICE_TABLE(of, ad9467_of_match); +static const struct spi_device_id ad9467_ids[] = { + { "ad9265", (kernel_ulong_t)&ad9467_chip_tbl[ID_AD9265] }, + { "ad9434", (kernel_ulong_t)&ad9467_chip_tbl[ID_AD9434] }, + { "ad9467", (kernel_ulong_t)&ad9467_chip_tbl[ID_AD9467] }, + {} +}; +MODULE_DEVICE_TABLE(spi, ad9467_ids); + static struct spi_driver ad9467_driver = { .driver = { .name = "ad9467", .of_match_table = ad9467_of_match, }, .probe = ad9467_probe, + .id_table = ad9467_ids, }; module_spi_driver(ad9467_driver); |