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) <u.kleine-koenig@baylibre.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20260519140101.1584946-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:01:01 +02:00 committed by Jakub Kicinski
parent a09dfac029
commit f186a3ae90
3 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);