nfc: Initialize mei_cl_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
mei_cl_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/cdc9bbac2e0743550970e565f57996c8a833446f.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:20 +02:00 committed by David Heidelberg
parent dc0650569a
commit 15aa65539a
No known key found for this signature in database
GPG Key ID: 60023FC4D3492072
2 changed files with 12 additions and 8 deletions

View File

@ -48,10 +48,12 @@ static void microread_mei_remove(struct mei_cl_device *cldev)
}
static struct mei_cl_device_id microread_mei_tbl[] = {
{ MICROREAD_DRIVER_NAME, MEI_NFC_UUID, MEI_CL_VERSION_ANY},
/* required last entry */
{ }
{
.name = MICROREAD_DRIVER_NAME,
.uuid = MEI_NFC_UUID,
.version = MEI_CL_VERSION_ANY,
},
{ /* required last entry */ }
};
MODULE_DEVICE_TABLE(mei, microread_mei_tbl);

View File

@ -47,10 +47,12 @@ static void pn544_mei_remove(struct mei_cl_device *cldev)
}
static struct mei_cl_device_id pn544_mei_tbl[] = {
{ PN544_DRIVER_NAME, MEI_NFC_UUID, MEI_CL_VERSION_ANY},
/* required last entry */
{ }
{
.name = PN544_DRIVER_NAME,
.uuid = MEI_NFC_UUID,
.version = MEI_CL_VERSION_ANY,
},
{ /* required last entry */ }
};
MODULE_DEVICE_TABLE(mei, pn544_mei_tbl);