summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>2026-07-17 16:50:50 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-31 14:20:50 +0200
commit230cb31dc3cb8163772fe7c47440227d5285f1e4 (patch)
treeb2ecbbc479022ee33c691a30e42f1d04e298ebad /drivers/misc
parentf21139e60b515d14fecb98344913a0cc35a8e2bc (diff)
downloadlinux-next-230cb31dc3cb8163772fe7c47440227d5285f1e4.tar.gz
linux-next-230cb31dc3cb8163772fe7c47440227d5285f1e4.zip
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/eeprom/idt_89hpesx.c116
-rw-r--r--drivers/misc/eeprom/max6875.c2
2 files changed, 59 insertions, 59 deletions
diff --git a/drivers/misc/eeprom/idt_89hpesx.c b/drivers/misc/eeprom/idt_89hpesx.c
index e056d2dea8c3..5bc0294349a0 100644
--- a/drivers/misc/eeprom/idt_89hpesx.c
+++ b/drivers/misc/eeprom/idt_89hpesx.c
@@ -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" },
-
- { "89hpes24nt6ag2" },
- { "89hpes32nt8ag2" },
- { "89hpes32nt8bg2" },
- { "89hpes12nt12g2" },
- { "89hpes16nt16g2" },
- { "89hpes24nt24g2" },
- { "89hpes32nt24ag2" },
- { "89hpes32nt24bg2" },
-
- { "89hpes12n3" },
- { "89hpes12n3a" },
- { "89hpes24n3" },
- { "89hpes24n3a" },
-
- { "89hpes32h8" },
- { "89hpes32h8g2" },
- { "89hpes48h12" },
- { "89hpes48h12g2" },
- { "89hpes48h12ag2" },
- { "89hpes16h16" },
- { "89hpes22h16" },
- { "89hpes22h16g2" },
- { "89hpes34h16" },
- { "89hpes34h16g2" },
- { "89hpes64h16" },
- { "89hpes64h16g2" },
- { "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 = "89hpes8nt2" },
+ { .name = "89hpes12nt3" },
+
+ { .name = "89hpes24nt6ag2" },
+ { .name = "89hpes32nt8ag2" },
+ { .name = "89hpes32nt8bg2" },
+ { .name = "89hpes12nt12g2" },
+ { .name = "89hpes16nt16g2" },
+ { .name = "89hpes24nt24g2" },
+ { .name = "89hpes32nt24ag2" },
+ { .name = "89hpes32nt24bg2" },
+
+ { .name = "89hpes12n3" },
+ { .name = "89hpes12n3a" },
+ { .name = "89hpes24n3" },
+ { .name = "89hpes24n3a" },
+
+ { .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" },
+
+ /* { .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);
diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c
index 5731d2dc8a57..be5e6d19be10 100644
--- a/drivers/misc/eeprom/max6875.c
+++ b/drivers/misc/eeprom/max6875.c
@@ -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);