From d9d8172a641af38397a5750db0dbfb41e4504727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Fri, 3 Jul 2026 17:46:24 +0200 Subject: [PATCH] nfc: Initialize spi_device_idarrays using member names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Link: https://patch.msgid.link/308a0d43ef042566ca595f1afa803cac592a4643.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/nfcmrvl/spi.c | 2 +- drivers/nfc/st-nci/spi.c | 4 ++-- drivers/nfc/st95hf/core.c | 2 +- drivers/nfc/trf7970a.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c index 6faf3fbd6911..8b8f00dac0f8 100644 --- a/drivers/nfc/nfcmrvl/spi.c +++ b/drivers/nfc/nfcmrvl/spi.c @@ -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); diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c index 1bbda3d0a7dc..1b97b2f3f441 100644 --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c @@ -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); diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 52fe81a557a0..d4e3049d138a 100644 --- a/drivers/nfc/st95hf/core.c +++ b/drivers/nfc/st95hf/core.c @@ -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); diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c index bb3f83adf7db..b9ea2b61c588 100644 --- a/drivers/nfc/trf7970a.c +++ b/drivers/nfc/trf7970a.c @@ -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" }, {} };