net: dsa: Use named initializers for struct i2c_device_id

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.

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

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20260519145722.1590298-2-u.kleine-koenig@baylibre.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Uwe Kleine-König (The Capable Hub) 2026-05-19 16:57:22 +02:00 committed by Jakub Kicinski
parent 0b87d2ab03
commit af998e3688
3 changed files with 5 additions and 5 deletions

View File

@ -89,7 +89,7 @@ static void lan9303_i2c_shutdown(struct i2c_client *client)
/*-------------------------------------------------------------------------*/
static const struct i2c_device_id lan9303_i2c_id[] = {
{ "lan9303" },
{ .name = "lan9303" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, lan9303_i2c_id);

View File

@ -80,8 +80,8 @@ static void ksz9477_i2c_shutdown(struct i2c_client *i2c)
}
static const struct i2c_device_id ksz9477_i2c_id[] = {
{ "ksz9477-switch" },
{}
{ .name = "ksz9477-switch" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ksz9477_i2c_id);

View File

@ -127,8 +127,8 @@ static void xrs700x_i2c_shutdown(struct i2c_client *i2c)
}
static const struct i2c_device_id xrs700x_i2c_id[] = {
{ "xrs700x-switch" },
{}
{ .name = "xrs700x-switch" },
{ }
};
MODULE_DEVICE_TABLE(i2c, xrs700x_i2c_id);