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>
This commit is contained in:
Uwe Kleine-König (The Capable Hub) 2026-07-03 17:46:17 +02:00 committed by David Heidelberg
parent 23096d9848
commit 42d470a98e
No known key found for this signature in database
GPG Key ID: 60023FC4D3492072
6 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);