]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nfc: Use named initializers for struct i2c_device_id
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Mon, 18 May 2026 13:33:11 +0000 (15:33 +0200)
committerDavid Heidelberg <david@ixit.cz>
Thu, 11 Jun 2026 18:24:47 +0000 (20:24 +0200)
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.

While touching all these arrays, unify usage of whitespace in the list
terminator.

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: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260518133311.644160-2-u.kleine-koenig@baylibre.com
Signed-off-by: David Heidelberg <david@ixit.cz>
drivers/nfc/microread/i2c.c
drivers/nfc/nfcmrvl/i2c.c
drivers/nfc/nxp-nci/i2c.c
drivers/nfc/pn533/i2c.c
drivers/nfc/pn544/i2c.c
drivers/nfc/s3fwrn5/i2c.c
drivers/nfc/st-nci/i2c.c
drivers/nfc/st21nfca/i2c.c

index f00cff7f9693fe65c58e6251d9e32563d48b3143..f45e883b8730c6849f682bd805cbab88e5ab0d99 100644 (file)
@@ -276,7 +276,7 @@ static void microread_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id microread_i2c_id[] = {
-       { MICROREAD_I2C_DRIVER_NAME },
+       { .name = MICROREAD_I2C_DRIVER_NAME },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, microread_i2c_id);
index 39ecf2aeda805ce9c2711a0cfbd4b5c5d166d1b3..66877a7d03f2a4757a95bb4f5917019fe6b77450 100644 (file)
@@ -252,8 +252,8 @@ static const struct of_device_id of_nfcmrvl_i2c_match[] __maybe_unused = {
 MODULE_DEVICE_TABLE(of, of_nfcmrvl_i2c_match);
 
 static const struct i2c_device_id nfcmrvl_i2c_id_table[] = {
-       { "nfcmrvl_i2c" },
-       {}
+       { .name = "nfcmrvl_i2c" },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, nfcmrvl_i2c_id_table);
 
index 1d9d7d6fd542eec6a01f45db53cfac940bc307c0..faebc89a7ef5a21dad38b5d614f4ab7a5a1b8717 100644 (file)
@@ -349,8 +349,8 @@ static void nxp_nci_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id nxp_nci_i2c_id_table[] = {
-       { "nxp-nci_i2c" },
-       {}
+       { .name = "nxp-nci_i2c" },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, nxp_nci_i2c_id_table);
 
index 132c050a365d67b1d6a95eea125a4c85aa92e3df..94aca9119f0f9ea2f277b6a3742fa0d5f14ff4f1 100644 (file)
@@ -249,8 +249,8 @@ static const struct of_device_id of_pn533_i2c_match[] __maybe_unused = {
 MODULE_DEVICE_TABLE(of, of_pn533_i2c_match);
 
 static const struct i2c_device_id pn533_i2c_id_table[] = {
-       { PN533_I2C_DRIVER_NAME },
-       {}
+       { .name = PN533_I2C_DRIVER_NAME },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, pn533_i2c_id_table);
 
index b31b5bef7187777ee3f3bf73618f4dd54fce8caa..dcfa96bd4345c112e953aefa6bc5f5a308ad898f 100644 (file)
@@ -44,8 +44,8 @@
                                         PN544_HCI_I2C_LLC_MAX_PAYLOAD)
 
 static const struct i2c_device_id pn544_hci_i2c_id_table[] = {
-       { "pn544" },
-       {}
+       { .name = "pn544" },
+       { }
 };
 
 MODULE_DEVICE_TABLE(i2c, pn544_hci_i2c_id_table);
index 91b8d1445efd46e3a1e028a7d73531c725c45a91..e9a34d27a36984f708691f6021b30dac8e989eaf 100644 (file)
@@ -205,8 +205,8 @@ static void s3fwrn5_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id s3fwrn5_i2c_id_table[] = {
-       { S3FWRN5_I2C_DRIVER_NAME },
-       {}
+       { .name = S3FWRN5_I2C_DRIVER_NAME },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, s3fwrn5_i2c_id_table);
 
index 416770adbebaa7fbca3dd4efa334a24c10c061ef..9ae839a6f5cc034efbdf90c3d85d4ee595e96b46 100644 (file)
@@ -257,8 +257,8 @@ static void st_nci_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id st_nci_i2c_id_table[] = {
-       { ST_NCI_DRIVER_NAME },
-       {}
+       { .name = ST_NCI_DRIVER_NAME },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, st_nci_i2c_id_table);
 
index 6d78613838068cc01f67c187625c75f70d26e8b2..aa5f4922b6b041f29640c670fa1753221ec63709 100644 (file)
@@ -572,8 +572,8 @@ static void st21nfca_hci_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id st21nfca_hci_i2c_id_table[] = {
-       { ST21NFCA_HCI_DRIVER_NAME },
-       {}
+       { .name = ST21NFCA_HCI_DRIVER_NAME },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, st21nfca_hci_i2c_id_table);