]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
phy: nxp-ptn3222: Use named initializers for struct i2c_device_id
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Tue, 19 May 2026 15:19:57 +0000 (17:19 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 11 Jun 2026 06:56:43 +0000 (12:26 +0530)
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.

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>
Link: https://patch.msgid.link/20260519151957.1593214-2-u.kleine-koenig@baylibre.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/phy-nxp-ptn3222.c

index c6179d8701e61d22be2cf9c7bec983c56564aad2..6cb79b5c4fdb8101c310fa6ffaa5840b82c47f34 100644 (file)
@@ -97,7 +97,7 @@ static int ptn3222_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id ptn3222_table[] = {
-       { "ptn3222" },
+       { .name = "ptn3222" },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, ptn3222_table);