From 15aa65539aa768c7acd9ae3a845df305caa72688 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:20 +0200 Subject: [PATCH] nfc: Initialize mei_cl_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 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) Link: https://patch.msgid.link/cdc9bbac2e0743550970e565f57996c8a833446f.1783091699.git.u.kleine-koenig@baylibre.com Signed-off-by: David Heidelberg --- drivers/nfc/microread/mei.c | 10 ++++++---- drivers/nfc/pn544/mei.c | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/nfc/microread/mei.c b/drivers/nfc/microread/mei.c index c256ae92d6b1..484e3ae0e875 100644 --- a/drivers/nfc/microread/mei.c +++ b/drivers/nfc/microread/mei.c @@ -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); diff --git a/drivers/nfc/pn544/mei.c b/drivers/nfc/pn544/mei.c index 3d3755cfa71e..7ca117186d3e 100644 --- a/drivers/nfc/pn544/mei.c +++ b/drivers/nfc/pn544/mei.c @@ -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);