]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpio: Initialize i2c_device_id arrays using member names
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Tue, 12 May 2026 15:21:25 +0000 (17:21 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Mon, 18 May 2026 07:47:18 +0000 (09:47 +0200)
commit553e26a45e0e66698c1e0043b705933102ac3edc
tree53e724508cc22e1267a28ffcabcd4840f6b409dc
parentcccecb5cbe72dd68dda93ad8c9e2f61c095a8ea3
gpio: Initialize i2c_device_id arrays using member names

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.

The mentioned robustness is relevant for a planned change to struct
i2c_device_id that replaces .driver_data by an anonymous union.

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/20260512152125.924433-2-u.kleine-koenig@baylibre.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-max732x.c
drivers/gpio/gpio-pca953x.c
drivers/gpio/gpio-pca9570.c
drivers/gpio/gpio-pcf857x.c