diff options
| author | Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> | 2026-06-17 11:41:50 +0200 |
|---|---|---|
| committer | Uwe Kleine-König <ukleinek@kernel.org> | 2026-07-03 23:26:53 +0200 |
| commit | 1a4920940ebfd8d907858abd8f8dd09b13752946 (patch) | |
| tree | bfe18770aad5dee21b7d46675498ef019db527da | |
| parent | 041d2acb68fb7220b8c7f8097da4f0915447f238 (diff) | |
| download | linux-next-1a4920940ebfd8d907858abd8f8dd09b13752946.tar.gz linux-next-1a4920940ebfd8d907858abd8f8dd09b13752946.zip | |
pwm: Use named initializers for platform_device_id arrays
Named initializers are better readable and more robust to changes of the
struct definition. This robustness is relevant for a planned change to
struct platform_device_id replacing .driver_data by an anonymous union.
While touching these arrays drop a comma after a list terminator.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/b515eb1644e793d019163fd2a717d3fccef857f5.1781689255.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
| -rw-r--r-- | drivers/pwm/pwm-adp5585.c | 4 | ||||
| -rw-r--r-- | drivers/pwm/pwm-pxa.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pwm/pwm-adp5585.c b/drivers/pwm/pwm-adp5585.c index 806f8d79b0d7..f4aa74b44ed2 100644 --- a/drivers/pwm/pwm-adp5585.c +++ b/drivers/pwm/pwm-adp5585.c @@ -203,8 +203,8 @@ static const struct adp5585_pwm_chip adp5589_pwm_chip_info = { }; static const struct platform_device_id adp5585_pwm_id_table[] = { - { "adp5585-pwm", (kernel_ulong_t)&adp5585_pwm_chip_info }, - { "adp5589-pwm", (kernel_ulong_t)&adp5589_pwm_chip_info }, + { .name = "adp5585-pwm", .driver_data = (kernel_ulong_t)&adp5585_pwm_chip_info }, + { .name = "adp5589-pwm", .driver_data = (kernel_ulong_t)&adp5589_pwm_chip_info }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(platform, adp5585_pwm_id_table); diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c index 80d2fa10919f..b844bb2dd92e 100644 --- a/drivers/pwm/pwm-pxa.c +++ b/drivers/pwm/pwm-pxa.c @@ -32,12 +32,12 @@ #define HAS_SECONDARY_PWM 0x10 static const struct platform_device_id pwm_id_table[] = { - /* PWM has_secondary_pwm? */ - { "pxa25x-pwm", 0 }, - { "pxa27x-pwm", HAS_SECONDARY_PWM }, - { "pxa168-pwm", 0 }, - { "pxa910-pwm", 0 }, - { }, + /* PWM has_secondary_pwm? */ + { .name = "pxa25x-pwm", .driver_data = 0 }, + { .name = "pxa27x-pwm", .driver_data = HAS_SECONDARY_PWM }, + { .name = "pxa168-pwm", .driver_data = 0 }, + { .name = "pxa910-pwm", .driver_data = 0 }, + { } }; MODULE_DEVICE_TABLE(platform, pwm_id_table); |
