From: Uwe Kleine-König (The Capable Hub) Date: Tue, 19 May 2026 14:01:01 +0000 (+0200) Subject: net: pse-pd: Use named initializers for arrays of i2c_device_data X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f186a3ae90611ab048f4093ab69420532d8a34e4;p=thirdparty%2Flinux.git net: pse-pd: Use named initializers for arrays of i2c_device_data 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 i2c_device_id that replaces .driver_data by an anonymous union. 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) Acked-by: Oleksij Rempel Link: https://patch.msgid.link/20260519140101.1584946-2-u.kleine-koenig@baylibre.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/pse-pd/pd692x0.c b/drivers/net/pse-pd/pd692x0.c index 4a3c852780f58..49b1527829ad9 100644 --- a/drivers/net/pse-pd/pd692x0.c +++ b/drivers/net/pse-pd/pd692x0.c @@ -1853,7 +1853,7 @@ static void pd692x0_i2c_remove(struct i2c_client *client) } static const struct i2c_device_id pd692x0_id[] = { - { PD692X0_PSE_NAME }, + { .name = PD692X0_PSE_NAME }, { } }; MODULE_DEVICE_TABLE(i2c, pd692x0_id); diff --git a/drivers/net/pse-pd/si3474.c b/drivers/net/pse-pd/si3474.c index aa07ffbce54d7..1845b9c51cf7a 100644 --- a/drivers/net/pse-pd/si3474.c +++ b/drivers/net/pse-pd/si3474.c @@ -550,8 +550,8 @@ static int si3474_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id si3474_id[] = { - { "si3474" }, - {} + { .name = "si3474" }, + { } }; MODULE_DEVICE_TABLE(i2c, si3474_id); diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index d40cb35a25478..49d6389da067c 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -1528,8 +1528,8 @@ static int tps23881_i2c_probe(struct i2c_client *client) } static const struct i2c_device_id tps23881_id[] = { - { "tps23881", .driver_data = (kernel_ulong_t)&tps23881_info[TPS23881] }, - { "tps23881b", .driver_data = (kernel_ulong_t)&tps23881_info[TPS23881B] }, + { .name = "tps23881", .driver_data = (kernel_ulong_t)&tps23881_info[TPS23881] }, + { .name = "tps23881b", .driver_data = (kernel_ulong_t)&tps23881_info[TPS23881B] }, { } }; MODULE_DEVICE_TABLE(i2c, tps23881_id);