]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: Use named initializers for arrays of i2c_device_data
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Mon, 18 May 2026 17:05:41 +0000 (19:05 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 22 May 2026 11:12:11 +0000 (12:12 +0100)
commit84bfaa6ceed629cbaeaccf03c4b287c719663284
tree7a0f32338102364b3255d13c28493c4362014471
parentae14c160f4bd6713d2910e86218ff4da8892c9e3
spi: Use named initializers for arrays of i2c_device_data

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.

While touching these arrays, drop a comma after 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>
Link: https://patch.msgid.link/20260518170542.807843-2-u.kleine-koenig@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-sc18is602.c
drivers/spi/spi-xcomm.c