From: Jonathan Cameron <jic23@kernel.org>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH net-next v1 1/1] iio: adc: tsc2046: silent spi_device_id warning
Date: Fri, 1 Jul 2022 17:49:40 +0100 [thread overview]
Message-ID: <20220701174940.6a0f3e02@jic23-huawei> (raw)
In-Reply-To: <20220630075155.2718293-1-o.rempel@pengutronix.de>
On Thu, 30 Jun 2022 09:51:55 +0200
Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> Add spi_device_id to silent following warning:
> SPI driver tsc2046 has no spi_device_id for ti,tsc2046e-adc
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
If the device was probed via this path (old school board file
or similar) then the device_get_matchdata() call will fail.
So I think we need to add handling for this case. Usually
along lines of
if (dev_fwnode)
.. device_get_match_data()
else
.. handle what is the spi_device_id structure
> ---
> drivers/iio/adc/ti-tsc2046.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
> index 55b35570ad8b..27dc959aee37 100644
> --- a/drivers/iio/adc/ti-tsc2046.c
> +++ b/drivers/iio/adc/ti-tsc2046.c
> @@ -833,11 +833,18 @@ static const struct of_device_id ads7950_of_table[] = {
> };
> MODULE_DEVICE_TABLE(of, ads7950_of_table);
>
> +static const struct spi_device_id tsc2046_adc_spi_ids[] = {
> + { "tsc2046e-adc" },
> + { },
> +};
> +MODULE_DEVICE_TABLE(spi, tsc2046_adc_spi_ids);
> +
> static struct spi_driver tsc2046_adc_driver = {
> .driver = {
> .name = "tsc2046",
> .of_match_table = ads7950_of_table,
> },
> + .id_table = tsc2046_adc_spi_ids,
> .probe = tsc2046_adc_probe,
> };
> module_spi_driver(tsc2046_adc_driver);
next prev parent reply other threads:[~2022-07-01 16:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 7:51 Oleksij Rempel
2022-07-01 16:49 ` Jonathan Cameron [this message]
2022-07-01 20:09 ` Andy Shevchenko
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=20220701174940.6a0f3e02@jic23-huawei \
--to=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
/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
all inboxes | Powered by JetHome®