[PATCH] pwm: mc33xs2410: Initialize spi_device_id arrays using member names

From: Uwe Kleine-König (The Capable Hub)

Date: Fri Jun 19 2026 - 12:14:27 EST


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@xxxxxxxxxxxx>
---
drivers/pwm/pwm-mc33xs2410.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-mc33xs2410.c b/drivers/pwm/pwm-mc33xs2410.c
index 6d99e3ff7239..9f89b60dda78 100644
--- a/drivers/pwm/pwm-mc33xs2410.c
+++ b/drivers/pwm/pwm-mc33xs2410.c
@@ -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);

base-commit: 3ce97bd3c4f18608335e709c24d6a40e7036cab8
--
2.47.3