]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform: arm64 Use named initializers for struct i2c_device_id
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Tue, 19 May 2026 14:43:41 +0000 (16:43 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 28 May 2026 11:43:39 +0000 (14:43 +0300)
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 all 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>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://patch.msgid.link/20260519144341.1589034-2-u.kleine-koenig@baylibre.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/arm64/acer-aspire1-ec.c
drivers/platform/arm64/huawei-gaokun-ec.c
drivers/platform/arm64/lenovo-thinkpad-t14s.c
drivers/platform/arm64/lenovo-yoga-c630.c

index 438532a047e68799ac53a16a4c813fc16be997b9..08d0b155a197afde50ef17a5a364ed7ecd80849c 100644 (file)
@@ -532,7 +532,7 @@ static int aspire_ec_resume(struct device *dev)
 }
 
 static const struct i2c_device_id aspire_ec_id[] = {
-       { "aspire1-ec", },
+       { .name = "aspire1-ec" },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, aspire_ec_id);
index a83ddc20b5a3d8594c6235f3d51006c29bd223f7..80a8ba8b8dda166e5cc3efa5f084a783ffa0eee6 100644 (file)
@@ -795,7 +795,7 @@ static int gaokun_ec_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id gaokun_ec_id[] = {
-       { "gaokun-ec", },
+       { .name = "gaokun-ec" },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, gaokun_ec_id);
index 5590302a5694f76ff0c2353b90cd852dc0514587..e7acb66b77f22eedd62d79b42eebb81bd63a94c5 100644 (file)
@@ -637,8 +637,8 @@ static const struct of_device_id t14s_ec_of_match[] = {
 MODULE_DEVICE_TABLE(of, t14s_ec_of_match);
 
 static const struct i2c_device_id t14s_ec_i2c_id_table[] = {
-       { "thinkpad-t14s-ec", },
-       {}
+       { .name = "thinkpad-t14s-ec" },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, t14s_ec_i2c_id_table);
 
index 75060c842b249c1b4cab21fef943266ae0b31d32..a8600a977fbc8244ea83587dfd1cd028c4a19dc5 100644 (file)
@@ -238,8 +238,8 @@ static const struct of_device_id yoga_c630_ec_of_match[] = {
 MODULE_DEVICE_TABLE(of, yoga_c630_ec_of_match);
 
 static const struct i2c_device_id yoga_c630_ec_i2c_id_table[] = {
-       { "yoga-c630-ec", },
-       {}
+       { .name = "yoga-c630-ec" },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, yoga_c630_ec_i2c_id_table);