Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: "Uwe Kleine-König (The Capable Hub)"
	<u.kleine-koenig@baylibre.com>,
	"Thorsten Blum" <thorsten.blum@linux.dev>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>
Cc: linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] crypto: atmel-sha204a - Drop of_device_id data
Date: Wed, 20 May 2026 09:49:49 +0200	[thread overview]
Message-ID: <46130020-eaa5-44ad-9c6d-62ccb30c19d9@app.fastmail.com> (raw)
In-Reply-To: <d0fc3069860f9e31122c1af635a1114dd2c443cf.1779260113.git.u.kleine-koenig@baylibre.com>


On Wed, 20 May 2026, at 09:01, Uwe Kleine-König (The Capable Hub) wrote:
> The driver binds to i2c devices only and thus in the absence of an
> assignment for .data in the of_device_id array i2c_get_match_data()
> falls back to .driver_data from the i2c_device_id array. So only provide
> &atsha204_quality once to reduce duplication.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> ---
>  drivers/crypto/atmel-sha204a.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c
> index 6e6ac4770416..f17e1f6af1a3 100644
> --- a/drivers/crypto/atmel-sha204a.c
> +++ b/drivers/crypto/atmel-sha204a.c
> @@ -208,8 +208,8 @@ static void atmel_sha204a_remove(struct i2c_client *client)
>  }
> 
>  static const struct of_device_id atmel_sha204a_dt_ids[] = {
> -	{ .compatible = "atmel,atsha204", .data = &atsha204_quality },
> -	{ .compatible = "atmel,atsha204a", },
> +	{ .compatible = "atmel,atsha204" },
> +	{ .compatible = "atmel,atsha204a" },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, atmel_sha204a_dt_ids);

Just trying to figure out how this is supposed to work:

i2c_get_match_data()
  data = device_get_match_data(&client->dev);
  ... returns NULL ...
  if (!data) {
    match = i2c_match_id(driver->id_table, client);
    ... compares client->name with { "atsha204", "atsha204a" }

So we will be relying on client->name having been set to either 
"atsha204" or "atsha204a" on the DT probe path before
i2c_match_data() is called, but I am struggling to see where
that might happen.







  reply	other threads:[~2026-05-20  7:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20  7:01 [PATCH v2 0/3] crypto - Rework i2c_device_id initialisation Uwe Kleine-König (The Capable Hub)
2026-05-20  7:01 ` [PATCH v2 1/3] crypto: atmel-sha204a - Drop of_device_id data Uwe Kleine-König (The Capable Hub)
2026-05-20  7:49   ` Ard Biesheuvel [this message]
2026-05-20 15:25     ` Uwe Kleine-König (The Capable Hub)
2026-05-20  7:01 ` [PATCH v2 2/3] crypto: atmel-sha204a - Use named initializers for struct i2c_device_id Uwe Kleine-König (The Capable Hub)
2026-05-20  7:01 ` [PATCH v2 3/3] crypto: atmel-ecc " Uwe Kleine-König (The Capable Hub)

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=46130020-eaa5-44ad-9c6d-62ccb30c19d9@app.fastmail.com \
    --to=ardb@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=thorsten.blum@linux.dev \
    --cc=u.kleine-koenig@baylibre.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