devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] iio: adc: tsc2046: silent spi_device_id warning
Date: Thu, 1 Sep 2022 17:20:49 +0300	[thread overview]
Message-ID: <CAHp75VcXS0inektGRKPCgqHv81c8gL29iiJSQKOL-c4u9kcz6A@mail.gmail.com> (raw)
In-Reply-To: <20220901041146.3652287-3-o.rempel@pengutronix.de>

On Thu, Sep 1, 2022 at 7:12 AM Oleksij Rempel <o.rempel@pengutronix.de> wrote:
>
> Add spi_device_id to silent following kernel runtime warning:
> "SPI driver tsc2046 has no spi_device_id for ti,tsc2046e-adc".

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> changes v3:
> - add missing point
> - remove unneeded blank line
> - assignment id at the definition line
> changes v2:
> - attach actual driver_data
> - use spi_get_device_id fallback
> ---
>  drivers/iio/adc/ti-tsc2046.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
> index bbc8b4137b0b1..d5d799972fefd 100644
> --- a/drivers/iio/adc/ti-tsc2046.c
> +++ b/drivers/iio/adc/ti-tsc2046.c
> @@ -762,6 +762,11 @@ static int tsc2046_adc_probe(struct spi_device *spi)
>         }
>
>         dcfg = device_get_match_data(dev);
> +       if (!dcfg) {
> +               const struct spi_device_id *id = spi_get_device_id(spi);
> +
> +               dcfg = (const struct tsc2046_adc_dcfg *)id->driver_data;
> +       }
>         if (!dcfg)
>                 return -EINVAL;
>
> @@ -878,11 +883,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", (unsigned long)&tsc2046_adc_dcfg_tsc2046e },
> +       { }
> +};
> +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,
>         .remove = tsc2046_adc_remove,
>  };
> --
> 2.30.2
>


-- 
With Best Regards,
Andy Shevchenko

      reply	other threads:[~2022-09-01 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01  4:11 [PATCH v3 1/3] dt-bindings: iio: adc: ti,tsc2046: add vref-supply property Oleksij Rempel
2022-09-01  4:11 ` [PATCH v3 2/3] iio: adc: tsc2046: add vref support Oleksij Rempel
2022-09-01  8:24   ` Marco Felsch
2022-09-01 11:35     ` Oleksij Rempel
2022-09-01 11:45   ` Jonathan Cameron
2022-09-01 11:53     ` Oleksij Rempel
2022-09-01  4:11 ` [PATCH v3 3/3] iio: adc: tsc2046: silent spi_device_id warning Oleksij Rempel
2022-09-01 14:20   ` Andy Shevchenko [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=CAHp75VcXS0inektGRKPCgqHv81c8gL29iiJSQKOL-c4u9kcz6A@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).