pwm: mc33xs2410: Initialize spi_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
spi_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled array, only its representation
in source form benefits.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/3fc7783506cc6429b8942cb7294926a6d4cb353e.1781885606.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
This commit is contained in:
Uwe Kleine-König (The Capable Hub)
2026-07-03 23:15:15 +02:00
committed by Uwe Kleine-König
parent dc59e4fea9
commit 041d2acb68
+1 -1
View File
@@ -381,7 +381,7 @@ static int mc33xs2410_probe(struct spi_device *spi)
}
static const struct spi_device_id mc33xs2410_spi_id[] = {
{ "mc33xs2410" },
{ .name = "mc33xs2410" },
{ }
};
MODULE_DEVICE_TABLE(spi, mc33xs2410_spi_id);