linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v1 1/1] iio: adc: tsc2046: silent spi_device_id warning
@ 2022-06-30  7:51 Oleksij Rempel
  2022-07-01 16:49 ` Jonathan Cameron
  2022-07-01 20:09 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Oleksij Rempel @ 2022-06-30  7:51 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen
  Cc: Oleksij Rempel, kernel, linux-kernel, linux-iio

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v1 1/1] iio: adc: tsc2046: silent spi_device_id warning
  2022-06-30  7:51 [PATCH net-next v1 1/1] iio: adc: tsc2046: silent spi_device_id warning Oleksij Rempel
@ 2022-07-01 16:49 ` Jonathan Cameron
  2022-07-01 20:09 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2022-07-01 16:49 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: Lars-Peter Clausen, kernel, linux-kernel, linux-iio

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v1 1/1] iio: adc: tsc2046: silent spi_device_id warning
  2022-06-30  7:51 [PATCH net-next v1 1/1] iio: adc: tsc2046: silent spi_device_id warning Oleksij Rempel
  2022-07-01 16:49 ` Jonathan Cameron
@ 2022-07-01 20:09 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2022-07-01 20:09 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Jonathan Cameron, Lars-Peter Clausen, Sascha Hauer,
	Linux Kernel Mailing List, linux-iio

On Thu, Jun 30, 2022 at 9:59 AM 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

...

> +static const struct spi_device_id tsc2046_adc_spi_ids[] = {
> +       { "tsc2046e-adc" },
> +       { },

No comma needed for terminator lines.

> +};

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-01 20:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30  7:51 [PATCH net-next v1 1/1] iio: adc: tsc2046: silent spi_device_id warning Oleksij Rempel
2022-07-01 16:49 ` Jonathan Cameron
2022-07-01 20:09 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).