Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Wei Yongjun <weiyongjun@huaweicloud.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Alexandru Tachici <alexandru.tachici@analog.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ad7192: Silent no spi_device_id warnings
Date: Mon, 19 Sep 2022 16:56:55 +0100	[thread overview]
Message-ID: <20220919165655.31b7fcb2@jic23-huawei> (raw)
In-Reply-To: <20220919145955.823346-1-weiyongjun@huaweicloud.com>

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


      reply	other threads:[~2022-09-19 15:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220919165655.31b7fcb2@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandru.tachici@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=weiyongjun1@huawei.com \
    --cc=weiyongjun@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox