From: Uwe Kleine-König (The Capable Hub) Date: Tue, 19 May 2026 15:08:18 +0000 (+0200) Subject: platform/chrome: Use named initializers for struct i2c_device_id X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ace8ee71e8ef4d6ef5a6501469df95237e1f7406;p=thirdparty%2Fkernel%2Flinux.git platform/chrome: 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. Signed-off-by: Uwe Kleine-König (The Capable Hub) Link: https://lore.kernel.org/r/20260519150819.1591409-2-u.kleine-koenig@baylibre.com Signed-off-by: Tzung-Bi Shih --- diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c index def1144a077ea..2f46be4a27569 100644 --- a/drivers/platform/chrome/cros_ec_i2c.c +++ b/drivers/platform/chrome/cros_ec_i2c.c @@ -348,7 +348,7 @@ MODULE_DEVICE_TABLE(of, cros_ec_i2c_of_match); #endif static const struct i2c_device_id cros_ec_i2c_id[] = { - { "cros-ec-i2c" }, + { .name = "cros-ec-i2c" }, { } }; MODULE_DEVICE_TABLE(i2c, cros_ec_i2c_id); diff --git a/drivers/platform/chrome/cros_hps_i2c.c b/drivers/platform/chrome/cros_hps_i2c.c index ac6498c593e3f..3b94856278312 100644 --- a/drivers/platform/chrome/cros_hps_i2c.c +++ b/drivers/platform/chrome/cros_hps_i2c.c @@ -131,7 +131,7 @@ static int hps_resume(struct device *dev) static DEFINE_RUNTIME_DEV_PM_OPS(hps_pm_ops, hps_suspend, hps_resume, NULL); static const struct i2c_device_id hps_i2c_id[] = { - { "cros-hps" }, + { .name = "cros-hps" }, { } }; MODULE_DEVICE_TABLE(i2c, hps_i2c_id);