ipmi: 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>
Message-ID: <20260519150156.1590826-2-u.kleine-koenig@baylibre.com>
Signed-off-by: Corey Minyard <corey@minyard.net>
This commit is contained in:
Uwe Kleine-König (The Capable Hub) 2026-05-19 17:01:56 +02:00 committed by Corey Minyard
parent cc3f0c6618
commit 8a8ba84886
4 changed files with 6 additions and 6 deletions

View File

@ -353,8 +353,8 @@ static void ipmb_remove(struct i2c_client *client)
}
static const struct i2c_device_id ipmb_id[] = {
{ "ipmb-dev" },
{}
{ .name = "ipmb-dev" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ipmb_id);

View File

@ -566,8 +566,8 @@ MODULE_DEVICE_TABLE(of, of_ipmi_ipmb_match);
#endif
static const struct i2c_device_id ipmi_ipmb_id[] = {
{ DEVICE_NAME },
{}
{ .name = DEVICE_NAME },
{ }
};
MODULE_DEVICE_TABLE(i2c, ipmi_ipmb_id);

View File

@ -2094,7 +2094,7 @@ static int dmi_ipmi_probe(struct platform_device *pdev)
#endif
static const struct i2c_device_id ssif_id[] = {
{ DEVICE_NAME },
{ .name = DEVICE_NAME },
{ }
};
MODULE_DEVICE_TABLE(i2c, ssif_id);

View File

@ -874,7 +874,7 @@ static const struct of_device_id ssif_bmc_match[] = {
MODULE_DEVICE_TABLE(of, ssif_bmc_match);
static const struct i2c_device_id ssif_bmc_id[] = {
{ DEVICE_NAME },
{ .name = DEVICE_NAME },
{ }
};
MODULE_DEVICE_TABLE(i2c, ssif_bmc_id);