nfc: Initialize spi_device_idarrays using member names

While being less compact, using named initializers allows to more easily
see which members of the structs are assigned which value without having
to lookup the declaration of the struct. And it's also more robust
against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct
spi_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation
in source form benefits.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/308a0d43ef042566ca595f1afa803cac592a4643.1783091699.git.u.kleine-koenig@baylibre.com
Signed-off-by: David Heidelberg <david@ixit.cz>
This commit is contained in:
Uwe Kleine-König (The Capable Hub) 2026-07-03 17:46:24 +02:00 committed by David Heidelberg
parent 5be3e23a47
commit d9d8172a64
No known key found for this signature in database
GPG Key ID: 60023FC4D3492072
4 changed files with 5 additions and 5 deletions

View File

@ -192,7 +192,7 @@ static const struct of_device_id of_nfcmrvl_spi_match[] = {
MODULE_DEVICE_TABLE(of, of_nfcmrvl_spi_match);
static const struct spi_device_id nfcmrvl_spi_id_table[] = {
{ "nfcmrvl_spi" },
{ .name = "nfcmrvl_spi" },
{ }
};
MODULE_DEVICE_TABLE(spi, nfcmrvl_spi_id_table);

View File

@ -271,8 +271,8 @@ static void st_nci_spi_remove(struct spi_device *dev)
}
static struct spi_device_id st_nci_spi_id_table[] = {
{ ST_NCI_SPI_DRIVER_NAME },
{ "st21nfcb-spi" },
{ .name = ST_NCI_SPI_DRIVER_NAME },
{ .name = "st21nfcb-spi" },
{}
};
MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table);

View File

@ -1049,7 +1049,7 @@ static const struct nfc_digital_ops st95hf_nfc_digital_ops = {
};
static const struct spi_device_id st95hf_id[] = {
{ "st95hf" },
{ .name = "st95hf" },
{}
};
MODULE_DEVICE_TABLE(spi, st95hf_id);

View File

@ -2310,7 +2310,7 @@ static const struct of_device_id trf7970a_of_match[] = {
MODULE_DEVICE_TABLE(of, trf7970a_of_match);
static const struct spi_device_id trf7970a_id_table[] = {
{ "trf7970a" },
{ .name = "trf7970a" },
{}
};