misc: eeprom: 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.

While touching all these arrays, unify usage of whitespace.

This patch doesn't modify the compiled arrays, only their representation
in source form benefits.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/e9ad2fe1d850ffd64eb053cb03395e7ca6f848dc.1784299069.git.u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Uwe Kleine-König (The Capable Hub) 2026-07-17 16:50:50 +02:00 committed by Greg Kroah-Hartman
parent f21139e60b
commit 230cb31dc3
2 changed files with 55 additions and 55 deletions

View File

@ -1375,12 +1375,12 @@ static void idt_remove(struct i2c_client *client)
* ee_ids - array of supported EEPROMs
*/
static const struct i2c_device_id ee_ids[] = {
{ "24c32", 4096},
{ "24c64", 8192},
{ "24c128", 16384},
{ "24c256", 32768},
{ "24c512", 65536},
{}
{ .name = "24c32", .driver_data = 4096 },
{ .name = "24c64", .driver_data = 8192 },
{ .name = "24c128", .driver_data = 16384 },
{ .name = "24c256", .driver_data = 32768 },
{ .name = "24c512", .driver_data = 65536 },
{ }
};
MODULE_DEVICE_TABLE(i2c, ee_ids);
@ -1388,58 +1388,58 @@ MODULE_DEVICE_TABLE(i2c, ee_ids);
* idt_ids - supported IDT 89HPESx devices
*/
static const struct i2c_device_id idt_ids[] = {
{ "89hpes8nt2" },
{ "89hpes12nt3" },
{ .name = "89hpes8nt2" },
{ .name = "89hpes12nt3" },
{ "89hpes24nt6ag2" },
{ "89hpes32nt8ag2" },
{ "89hpes32nt8bg2" },
{ "89hpes12nt12g2" },
{ "89hpes16nt16g2" },
{ "89hpes24nt24g2" },
{ "89hpes32nt24ag2" },
{ "89hpes32nt24bg2" },
{ .name = "89hpes24nt6ag2" },
{ .name = "89hpes32nt8ag2" },
{ .name = "89hpes32nt8bg2" },
{ .name = "89hpes12nt12g2" },
{ .name = "89hpes16nt16g2" },
{ .name = "89hpes24nt24g2" },
{ .name = "89hpes32nt24ag2" },
{ .name = "89hpes32nt24bg2" },
{ "89hpes12n3" },
{ "89hpes12n3a" },
{ "89hpes24n3" },
{ "89hpes24n3a" },
{ .name = "89hpes12n3" },
{ .name = "89hpes12n3a" },
{ .name = "89hpes24n3" },
{ .name = "89hpes24n3a" },
{ "89hpes32h8" },
{ "89hpes32h8g2" },
{ "89hpes48h12" },
{ "89hpes48h12g2" },
{ "89hpes48h12ag2" },
{ "89hpes16h16" },
{ "89hpes22h16" },
{ "89hpes22h16g2" },
{ "89hpes34h16" },
{ "89hpes34h16g2" },
{ "89hpes64h16" },
{ "89hpes64h16g2" },
{ "89hpes64h16ag2" },
{ .name = "89hpes32h8" },
{ .name = "89hpes32h8g2" },
{ .name = "89hpes48h12" },
{ .name = "89hpes48h12g2" },
{ .name = "89hpes48h12ag2" },
{ .name = "89hpes16h16" },
{ .name = "89hpes22h16" },
{ .name = "89hpes22h16g2" },
{ .name = "89hpes34h16" },
{ .name = "89hpes34h16g2" },
{ .name = "89hpes64h16" },
{ .name = "89hpes64h16g2" },
{ .name = "89hpes64h16ag2" },
/* { "89hpes3t3" }, // No SMBus-slave iface */
{ "89hpes12t3g2" },
{ "89hpes24t3g2" },
/* { "89hpes4t4" }, // No SMBus-slave iface */
{ "89hpes16t4" },
{ "89hpes4t4g2" },
{ "89hpes10t4g2" },
{ "89hpes16t4g2" },
{ "89hpes16t4ag2" },
{ "89hpes5t5" },
{ "89hpes6t5" },
{ "89hpes8t5" },
{ "89hpes8t5a" },
{ "89hpes24t6" },
{ "89hpes6t6g2" },
{ "89hpes24t6g2" },
{ "89hpes16t7" },
{ "89hpes32t8" },
{ "89hpes32t8g2" },
{ "89hpes48t12" },
{ "89hpes48t12g2" },
/* { .name = "89hpes3t3" }, // No SMBus-slave iface */
{ .name = "89hpes12t3g2" },
{ .name = "89hpes24t3g2" },
/* { .name = "89hpes4t4" }, // No SMBus-slave iface */
{ .name = "89hpes16t4" },
{ .name = "89hpes4t4g2" },
{ .name = "89hpes10t4g2" },
{ .name = "89hpes16t4g2" },
{ .name = "89hpes16t4ag2" },
{ .name = "89hpes5t5" },
{ .name = "89hpes6t5" },
{ .name = "89hpes8t5" },
{ .name = "89hpes8t5a" },
{ .name = "89hpes24t6" },
{ .name = "89hpes6t6g2" },
{ .name = "89hpes24t6g2" },
{ .name = "89hpes16t7" },
{ .name = "89hpes32t8" },
{ .name = "89hpes32t8g2" },
{ .name = "89hpes48t12" },
{ .name = "89hpes48t12g2" },
{ /* END OF LIST */ }
};
MODULE_DEVICE_TABLE(i2c, idt_ids);

View File

@ -183,7 +183,7 @@ static void max6875_remove(struct i2c_client *client)
}
static const struct i2c_device_id max6875_id[] = {
{ "max6875" },
{ .name = "max6875" },
{ }
};
MODULE_DEVICE_TABLE(i2c, max6875_id);