diff mbox series

iio: adc: ad7192: Silent no spi_device_id warnings

Message ID 20220919145955.823346-1-weiyongjun@huaweicloud.com (mailing list archive)
State Changes Requested
Headers show
Series iio: adc: ad7192: Silent no spi_device_id warnings | expand

Commit Message

Wei Yongjun Sept. 19, 2022, 2:59 p.m. UTC
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(+)

Comments

Jonathan Cameron Sept. 19, 2022, 3:56 p.m. UTC | #1
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);
>
diff mbox series

Patch

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);