summaryrefslogtreecommitdiff
path: root/drivers/nfc
diff options
context:
space:
mode:
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>2026-07-03 17:46:17 +0200
committerDavid Heidelberg <david@ixit.cz>2026-08-11 18:13:59 +0200
commit42d470a98e22e370262d8227c65f16a3b317a7f8 (patch)
treeb34a5ade7110090893fa8c609e8ddfad3debece4 /drivers/nfc
parent23096d984885af49ac64b18b2d245fbd71b6c0ce (diff)
nfc: Initialize acpi_device_id arrays 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 acpi_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. The former was confirmed with x86 and arm64 builds. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Reviewed-by: Ian Ray <ian.ray@gehealthcare.com> Link: https://patch.msgid.link/5f60cd3e9831aac3995ed1a1b074ca1ae32e5286.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg <david@ixit.cz>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/fdp/i2c.c2
-rw-r--r--drivers/nfc/nxp-nci/i2c.c6
-rw-r--r--drivers/nfc/pn544/i2c.c2
-rw-r--r--drivers/nfc/st-nci/i2c.c4
-rw-r--r--drivers/nfc/st-nci/spi.c2
-rw-r--r--drivers/nfc/st21nfca/i2c.c2
6 files changed, 9 insertions, 9 deletions
diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
index 9d589b388432..47f3838ac9d4 100644
--- a/drivers/nfc/fdp/i2c.c
+++ b/drivers/nfc/fdp/i2c.c
@@ -349,7 +349,7 @@ static void fdp_nci_i2c_remove(struct i2c_client *client)
}
static const struct acpi_device_id fdp_nci_i2c_acpi_match[] = {
- { "INT339A" },
+ { .id = "INT339A" },
{}
};
MODULE_DEVICE_TABLE(acpi, fdp_nci_i2c_acpi_match);
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 564f38735510..3fa24f540802 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -364,9 +364,9 @@ MODULE_DEVICE_TABLE(of, of_nxp_nci_i2c_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id acpi_id[] = {
- { "NXP1001" },
- { "NXP1002" },
- { "NXP7471" },
+ { .id = "NXP1001" },
+ { .id = "NXP1002" },
+ { .id = "NXP7471" },
{ }
};
MODULE_DEVICE_TABLE(acpi, acpi_id);
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index 66d070b18b4d..ccca07eb828c 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -51,7 +51,7 @@ static const struct i2c_device_id pn544_hci_i2c_id_table[] = {
MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table);
static const struct acpi_device_id pn544_hci_i2c_acpi_match[] = {
- { "NXP5440" },
+ { .id = "NXP5440" },
{}
};
MODULE_DEVICE_TABLE(acpi, pn544_hci_i2c_acpi_match);
diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c
index 4ddf0cc2a259..3906a806ec8b 100644
--- a/drivers/nfc/st-nci/i2c.c
+++ b/drivers/nfc/st-nci/i2c.c
@@ -263,8 +263,8 @@ static const struct i2c_device_id st_nci_i2c_id_table[] = {
MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table);
static const struct acpi_device_id st_nci_i2c_acpi_match[] = {
- {"SMO2101"},
- {"SMO2102"},
+ { .id = "SMO2101" },
+ { .id = "SMO2102" },
{}
};
MODULE_DEVICE_TABLE(acpi, st_nci_i2c_acpi_match);
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index c94d67f33184..8fc60a972d98 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -278,7 +278,7 @@ static struct spi_device_id st_nci_spi_id_table[] = {
MODULE_DEVICE_TABLE(spi, st_nci_spi_id_table);
static const struct acpi_device_id st_nci_spi_acpi_match[] = {
- { "SMO2101" },
+ { .id = "SMO2101" },
{}
};
MODULE_DEVICE_TABLE(acpi, st_nci_spi_acpi_match);
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c
index d6cb74a89f93..e5109f701795 100644
--- a/drivers/nfc/st21nfca/i2c.c
+++ b/drivers/nfc/st21nfca/i2c.c
@@ -578,7 +578,7 @@ static const struct i2c_device_id st21nfca_hci_i2c_id_table[] = {
MODULE_DEVICE_TABLE(i2c, st21nfca_hci_i2c_id_table);
static const struct acpi_device_id st21nfca_hci_i2c_acpi_match[] = {
- { "SMO2100" },
+ { .id = "SMO2100" },
{}
};
MODULE_DEVICE_TABLE(acpi, st21nfca_hci_i2c_acpi_match);