]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pwm: pca9685: Use named initializers for struct i2c_device_id
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Mon, 18 May 2026 17:23:22 +0000 (19:23 +0200)
committerUwe Kleine-König <ukleinek@kernel.org>
Tue, 26 May 2026 05:50:42 +0000 (07:50 +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.

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>
Link: https://patch.msgid.link/20260518172323.932774-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/pwm-pca9685.c

index 107bebec3546edac2988dc1c524df7c78762f3d7..a02255a64ea8164d0bdbb90b6b9046a9ce0614ec 100644 (file)
@@ -538,7 +538,7 @@ static int __maybe_unused pca9685_pwm_runtime_resume(struct device *dev)
 }
 
 static const struct i2c_device_id pca9685_id[] = {
-       { "pca9685" },
+       { .name = "pca9685" },
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(i2c, pca9685_id);