* [PATCH] iio: adc: ad7192: Silent no spi_device_id warnings
@ 2022-09-19 14:59 Wei Yongjun
2022-09-19 15:56 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2022-09-19 14:59 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Alexandru Tachici,
Jonathan Cameron
Cc: Wei Yongjun, linux-iio
From: Wei Yongjun <weiyongjun1@huawei.com>
Add spi_device_id entries to silent following SPI warnings:
SPI driver ad7192 has no spi_device_id for adi,ad7190
SPI driver ad7192 has no spi_device_id for adi,ad7193
SPI driver ad7192 has no spi_device_id for adi,ad7195
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/iio/adc/ad7192.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
index d71977be7d22..029025878bb0 100644
--- a/drivers/iio/adc/ad7192.c
+++ b/drivers/iio/adc/ad7192.c
@@ -1098,12 +1098,22 @@ static const struct of_device_id ad7192_of_match[] = {
};
MODULE_DEVICE_TABLE(of, ad7192_of_match);
+static const struct spi_device_id ad7192_ids[] = {
+ { "ad7190", (kernel_ulong_t)&ad7192_chip_info_tbl[ID_AD7190] },
+ { "ad7192", (kernel_ulong_t)&ad7192_chip_info_tbl[ID_AD7192] },
+ { "ad7193", (kernel_ulong_t)&ad7192_chip_info_tbl[ID_AD7193] },
+ { "ad7195", (kernel_ulong_t)&ad7192_chip_info_tbl[ID_AD7195] },
+ { },
+};
+MODULE_DEVICE_TABLE(spi, ad7192_ids);
+
static struct spi_driver ad7192_driver = {
.driver = {
.name = "ad7192",
.of_match_table = ad7192_of_match,
},
.probe = ad7192_probe,
+ .id_table = ad7192_ids,
};
module_spi_driver(ad7192_driver);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] iio: adc: ad7192: Silent no spi_device_id warnings
2022-09-19 14:59 [PATCH] iio: adc: ad7192: Silent no spi_device_id warnings Wei Yongjun
@ 2022-09-19 15:56 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-09-19 15:56 UTC (permalink / raw)
To: Wei Yongjun
Cc: Lars-Peter Clausen, Michael Hennerich, Alexandru Tachici,
Wei Yongjun, linux-iio
On Mon, 19 Sep 2022 14:59:55 +0000
Wei Yongjun <weiyongjun@huaweicloud.com> wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> Add spi_device_id entries to silent following SPI warnings:
>
> SPI driver ad7192 has no spi_device_id for adi,ad7190
> SPI driver ad7192 has no spi_device_id for adi,ad7193
> SPI driver ad7192 has no spi_device_id for adi,ad7195
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Hi Wei Yongjun,
Please also make use of the spi_get_device_id(spi)->driver_data
path to provide the chip info structure if
of_device_get_match_data() returns NULL.
Interesting that this driver has not yet been converted to
generic device properties. Looks straight forward if anyone
wants to tidy that up as well. Just convert all the
of specific calls over to generic forms from linux/property.h
Thanks,
Jonathan
> ---
> drivers/iio/adc/ad7192.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
> index d71977be7d22..029025878bb0 100644
> --- a/drivers/iio/adc/ad7192.c
> +++ b/drivers/iio/adc/ad7192.c
> @@ -1098,12 +1098,22 @@ static const struct of_device_id ad7192_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, ad7192_of_match);
>
> +static const struct spi_device_id ad7192_ids[] = {
> + { "ad7190", (kernel_ulong_t)&ad7192_chip_info_tbl[ID_AD7190] },
> + { "ad7192", (kernel_ulong_t)&ad7192_chip_info_tbl[ID_AD7192] },
> + { "ad7193", (kernel_ulong_t)&ad7192_chip_info_tbl[ID_AD7193] },
> + { "ad7195", (kernel_ulong_t)&ad7192_chip_info_tbl[ID_AD7195] },
> + { },
> +};
> +MODULE_DEVICE_TABLE(spi, ad7192_ids);
> +
> static struct spi_driver ad7192_driver = {
> .driver = {
> .name = "ad7192",
> .of_match_table = ad7192_of_match,
> },
> .probe = ad7192_probe,
> + .id_table = ad7192_ids,
> };
> module_spi_driver(ad7192_driver);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-19 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19 14:59 [PATCH] iio: adc: ad7192: Silent no spi_device_id warnings Wei Yongjun
2022-09-19 15:56 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox