]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
usb: misc: Use named initializers for struct i2c_device_id
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Mon, 18 May 2026 13:55:36 +0000 (15:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 May 2026 14:52:34 +0000 (16:52 +0200)
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 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>
Reviewed-by: Richard Leitner <richard.leitner@linux.dev>
Link: https://patch.msgid.link/20260518135536.781168-2-u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usb251xb.c
drivers/usb/misc/usb3503.c
drivers/usb/misc/usb4604.c

index 7c0778631bea89dbbd687b10df08a6a1b1772691..fb0693742f018273451db271a143b5d6b2424f71 100644 (file)
@@ -746,15 +746,15 @@ static int usb251xb_i2c_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(usb251xb_i2c_pm_ops, usb251xb_i2c_suspend, usb251xb_i2c_resume);
 
 static const struct i2c_device_id usb251xb_id[] = {
-       { "usb2422" },
-       { "usb2512b" },
-       { "usb2512bi" },
-       { "usb2513b" },
-       { "usb2513bi" },
-       { "usb2514b" },
-       { "usb2514bi" },
-       { "usb2517" },
-       { "usb2517i" },
+       { .name = "usb2422" },
+       { .name = "usb2512b" },
+       { .name = "usb2512bi" },
+       { .name = "usb2513b" },
+       { .name = "usb2513bi" },
+       { .name = "usb2514b" },
+       { .name = "usb2514bi" },
+       { .name = "usb2517" },
+       { .name = "usb2517i" },
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(i2c, usb251xb_id);
index 322e59381b7830e7937ff2c5afdc649c6b81e723..759770a1326061aeb3de69ab782f3989582c6e6b 100644 (file)
@@ -390,7 +390,7 @@ static SIMPLE_DEV_PM_OPS(usb3503_platform_pm_ops, usb3503_platform_suspend,
                usb3503_platform_resume);
 
 static const struct i2c_device_id usb3503_id[] = {
-       { USB3503_I2C_NAME },
+       { .name = USB3503_I2C_NAME },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, usb3503_id);
index c9a2fb3518ae45e5b736ec1fecc355c541c808f1..2ae9656715e016fa1e9fc6314cc207bac495ef84 100644 (file)
@@ -135,7 +135,7 @@ static SIMPLE_DEV_PM_OPS(usb4604_i2c_pm_ops, usb4604_i2c_suspend,
                usb4604_i2c_resume);
 
 static const struct i2c_device_id usb4604_id[] = {
-       { "usb4604" },
+       { .name = "usb4604" },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, usb4604_id);