mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: Mariel Tinaco <Mariel.Tinaco@analog.com>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: dac: ad8460: add SPI device match table
Date: Sat, 19 Oct 2024 12:26:29 +0100	[thread overview]
Message-ID: <20241019122629.268197e8@jic23-huawei> (raw)
In-Reply-To: <20241018-iio-dac-ad8460-add-spi-match-table-v1-1-84a5f903bf50@baylibre.com>

On Fri, 18 Oct 2024 16:44:48 -0500
David Lechner <dlechner@baylibre.com> wrote:

> Add SPI device match table for ADI AD8460 DAC. As described in [1], this
> is required for the module to automatically load, even when using DT.
> 
> [1]: https://lore.kernel.org/all/20210921192149.50740-1-broonie@kernel.org/
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>
One day I'll remember to check for this when reviewing.

This is actually another corner case and fine for now.
In the link you reference check the driver name matching just
before the warning print.

That works if there is only one ID. Still better to clean
this up as a form of hardening against future problems.

Applied.

Jonathan

> ---
>  drivers/iio/dac/ad8460.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/iio/dac/ad8460.c b/drivers/iio/dac/ad8460.c
> index dc8c76ba573d..ded442d4060d 100644
> --- a/drivers/iio/dac/ad8460.c
> +++ b/drivers/iio/dac/ad8460.c
> @@ -929,12 +929,19 @@ static const struct of_device_id ad8460_of_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, ad8460_of_match);
>  
> +static const struct spi_device_id ad8460_spi_match[] = {
> +	{ .name = "ad8460" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(spi, ad8460_spi_match);
> +
>  static struct spi_driver ad8460_driver = {
>  	.driver = {
>  		.name = "ad8460",
>  		.of_match_table = ad8460_of_match,
>  	},
>  	.probe = ad8460_probe,
> +	.id_table = ad8460_spi_match,
>  };
>  module_spi_driver(ad8460_driver);
>  
> 
> ---
> base-commit: f2493655d2d3d5c6958ed996b043c821c23ae8d3
> change-id: 20241018-iio-dac-ad8460-add-spi-match-table-906dd36cb033
> 
> Best regards,


      reply	other threads:[~2024-10-19 11:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 21:44 David Lechner
2024-10-19 11:26 ` 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=20241019122629.268197e8@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Mariel.Tinaco@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®