* [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays
@ 2026-05-27 14:57 Uwe Kleine-König (The Capable Hub)
2026-05-27 14:57 ` [PATCH v1 1/3] gpio: cros-ec: Drop unused assignment of platform_device_id driver data Uwe Kleine-König (The Capable Hub)
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-27 14:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Benson Leung
Cc: Guenter Roeck, linux-gpio, chrome-platform, linux-kernel,
Laurent Pinchart, Matti Vaittinen, Marek Vasut,
André Draszik, Robert Jarzmik, Aaro Koskinen,
Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren,
linux-pwm, linux-renesas-soc, linux-omap
Hello,
this series targets to use named initializers for platform_device_id
arrays. In general these are better readable for humans and more robust
to changes in the respective struct definition.
This robustness is needed as I want to do
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -610,4 +610,7 @@ struct dmi_system_id {
struct platform_device_id {
char name[PLATFORM_NAME_SIZE];
- kernel_ulong_t driver_data;
+ union {
+ kernel_ulong_t driver_data;
+ const void *driver_data_ptr;
+ };
};
which allows dropping several casts and eases porting CHERI to mainline
linux. A possible follow-up change is the following example:
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 5d61053e0596..03bc8e859d73 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -534,7 +534,7 @@ static struct irq_chip pxa_muxed_gpio_chip = {
static int pxa_gpio_nums(struct platform_device *pdev)
{
const struct platform_device_id *id = platform_get_device_id(pdev);
- struct pxa_gpio_id *pxa_id = (struct pxa_gpio_id *)id->driver_data;
+ struct pxa_gpio_id *pxa_id = id->driver_data_ptr;
int count = 0;
switch (pxa_id->type) {
@@ -708,14 +708,14 @@ static int pxa_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id gpio_id_table[] = {
- { .name = "pxa25x-gpio", .driver_data = (unsigned long)&pxa25x_id },
- { .name = "pxa26x-gpio", .driver_data = (unsigned long)&pxa26x_id },
- { .name = "pxa27x-gpio", .driver_data = (unsigned long)&pxa27x_id },
- { .name = "pxa3xx-gpio", .driver_data = (unsigned long)&pxa3xx_id },
- { .name = "pxa93x-gpio", .driver_data = (unsigned long)&pxa93x_id },
- { .name = "mmp-gpio", .driver_data = (unsigned long)&mmp_id },
- { .name = "mmp2-gpio", .driver_data = (unsigned long)&mmp2_id },
- { .name = "pxa1928-gpio", .driver_data = (unsigned long)&pxa1928_id },
+ { .name = "pxa25x-gpio", .driver_data_ptr = &pxa25x_id },
+ { .name = "pxa26x-gpio", .driver_data_ptr = &pxa26x_id },
+ { .name = "pxa27x-gpio", .driver_data_ptr = &pxa27x_id },
+ { .name = "pxa3xx-gpio", .driver_data_ptr = &pxa3xx_id },
+ { .name = "pxa93x-gpio", .driver_data_ptr = &pxa93x_id },
+ { .name = "mmp-gpio", .driver_data_ptr = &mmp_id },
+ { .name = "mmp2-gpio", .driver_data_ptr = &mmp2_id },
+ { .name = "pxa1928-gpio", .driver_data_ptr = &pxa1928_id },
{ }
};
increasing readability due to less casting. Also this results in the
compiler warning:
drivers/gpio/gpio-pxa.c: In function ‘pxa_gpio_nums’:
drivers/gpio/gpio-pxa.c:537:38: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
537 | struct pxa_gpio_id *pxa_id = id->driver_data_ptr;
| ^~
which is a good thing as adding the needed const to fix this warning
improves type safety.
If you consider the last patch mostly churn, just drop it.
Best regards
Uwe
Uwe Kleine-König (The Capable Hub) (3):
gpio: cros-ec: Drop unused assignment of platform_device_id driver
data
gpio: Use named initializers for platform_device_id arrays
gpio: max77620: Unify usage of space and comma in platform_device_id
array
drivers/gpio/gpio-adp5585.c | 4 ++--
drivers/gpio/gpio-bd72720.c | 4 ++--
drivers/gpio/gpio-bd9571mwv.c | 4 ++--
drivers/gpio/gpio-cros-ec.c | 4 ++--
drivers/gpio/gpio-lp873x.c | 2 +-
drivers/gpio/gpio-lp87565.c | 2 +-
drivers/gpio/gpio-max77620.c | 2 +-
drivers/gpio/gpio-max77759.c | 2 +-
drivers/gpio/gpio-pxa.c | 18 +++++++++---------
drivers/gpio/gpio-tps65086.c | 2 +-
drivers/gpio/gpio-tps65218.c | 2 +-
drivers/gpio/gpio-tps65219.c | 4 ++--
drivers/gpio/gpio-tps65912.c | 2 +-
drivers/gpio/gpio-ts5500.c | 8 ++++----
14 files changed, 30 insertions(+), 30 deletions(-)
base-commit: e7e28506af98ce4e1059e5ec59334b335c00a246
--
2.47.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v1 1/3] gpio: cros-ec: Drop unused assignment of platform_device_id driver data
2026-05-27 14:57 [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-05-27 14:57 ` Uwe Kleine-König (The Capable Hub)
2026-05-28 2:20 ` Tzung-Bi Shih
2026-05-27 14:57 ` [PATCH v1 2/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-27 14:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Benson Leung
Cc: Guenter Roeck, linux-gpio, chrome-platform, linux-kernel
The driver explicitly set the .driver_data member of struct
platform_device_id to zero without relying on that value. Drop this
unused assignments.
While touching this array unify spacing and use named initializers for
.name.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
drivers/gpio/gpio-cros-ec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-cros-ec.c b/drivers/gpio/gpio-cros-ec.c
index 435483826c6e..9deda8a9d11a 100644
--- a/drivers/gpio/gpio-cros-ec.c
+++ b/drivers/gpio/gpio-cros-ec.c
@@ -196,8 +196,8 @@ static int cros_ec_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id cros_ec_gpio_id[] = {
- { "cros-ec-gpio", 0 },
- {}
+ { .name = "cros-ec-gpio" },
+ { }
};
MODULE_DEVICE_TABLE(platform, cros_ec_gpio_id);
--
2.47.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 2/3] gpio: Use named initializers for platform_device_id arrays
2026-05-27 14:57 [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-27 14:57 ` [PATCH v1 1/3] gpio: cros-ec: Drop unused assignment of platform_device_id driver data Uwe Kleine-König (The Capable Hub)
@ 2026-05-27 14:57 ` Uwe Kleine-König (The Capable Hub)
2026-05-29 7:57 ` Matti Vaittinen
2026-05-27 14:57 ` [PATCH v1 3/3] gpio: max77620: Unify usage of space and comma in platform_device_id array Uwe Kleine-König (The Capable Hub)
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-27 14:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Laurent Pinchart, Matti Vaittinen, Marek Vasut,
André Draszik, Robert Jarzmik, Aaro Koskinen,
Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren,
linux-gpio, linux-pwm, linux-kernel, linux-renesas-soc,
linux-omap
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 unit.
While touching these arrays unify spacing and usage of commas.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
drivers/gpio/gpio-adp5585.c | 4 ++--
drivers/gpio/gpio-bd72720.c | 4 ++--
drivers/gpio/gpio-bd9571mwv.c | 4 ++--
drivers/gpio/gpio-lp873x.c | 2 +-
drivers/gpio/gpio-lp87565.c | 2 +-
drivers/gpio/gpio-max77759.c | 2 +-
drivers/gpio/gpio-pxa.c | 18 +++++++++---------
drivers/gpio/gpio-tps65086.c | 2 +-
drivers/gpio/gpio-tps65218.c | 2 +-
drivers/gpio/gpio-tps65219.c | 4 ++--
drivers/gpio/gpio-tps65912.c | 2 +-
drivers/gpio/gpio-ts5500.c | 8 ++++----
12 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/drivers/gpio/gpio-adp5585.c b/drivers/gpio/gpio-adp5585.c
index 0fd3cc26d017..6f10fc646008 100644
--- a/drivers/gpio/gpio-adp5585.c
+++ b/drivers/gpio/gpio-adp5585.c
@@ -507,8 +507,8 @@ static const struct adp5585_gpio_chip adp5589_gpio_chip_info = {
};
static const struct platform_device_id adp5585_gpio_id_table[] = {
- { "adp5585-gpio", (kernel_ulong_t)&adp5585_gpio_chip_info },
- { "adp5589-gpio", (kernel_ulong_t)&adp5589_gpio_chip_info },
+ { .name = "adp5585-gpio", .driver_data = (kernel_ulong_t)&adp5585_gpio_chip_info },
+ { .name = "adp5589-gpio", .driver_data = (kernel_ulong_t)&adp5589_gpio_chip_info },
{ /* Sentinel */ }
};
MODULE_DEVICE_TABLE(platform, adp5585_gpio_id_table);
diff --git a/drivers/gpio/gpio-bd72720.c b/drivers/gpio/gpio-bd72720.c
index d0f936ed80af..306e23411209 100644
--- a/drivers/gpio/gpio-bd72720.c
+++ b/drivers/gpio/gpio-bd72720.c
@@ -263,8 +263,8 @@ static int gpo_bd72720_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd72720_gpio_id[] = {
- { "bd72720-gpio" },
- { },
+ { .name = "bd72720-gpio" },
+ { }
};
MODULE_DEVICE_TABLE(platform, bd72720_gpio_id);
diff --git a/drivers/gpio/gpio-bd9571mwv.c b/drivers/gpio/gpio-bd9571mwv.c
index cc5b1746f2fe..f829fc40c02b 100644
--- a/drivers/gpio/gpio-bd9571mwv.c
+++ b/drivers/gpio/gpio-bd9571mwv.c
@@ -110,8 +110,8 @@ static int bd9571mwv_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd9571mwv_gpio_id_table[] = {
- { "bd9571mwv-gpio", ROHM_CHIP_TYPE_BD9571 },
- { "bd9574mwf-gpio", ROHM_CHIP_TYPE_BD9574 },
+ { .name = "bd9571mwv-gpio", .driver_data = ROHM_CHIP_TYPE_BD9571 },
+ { .name = "bd9574mwf-gpio", .driver_data = ROHM_CHIP_TYPE_BD9574 },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, bd9571mwv_gpio_id_table);
diff --git a/drivers/gpio/gpio-lp873x.c b/drivers/gpio/gpio-lp873x.c
index f4413fa5a811..0d1bd9df265a 100644
--- a/drivers/gpio/gpio-lp873x.c
+++ b/drivers/gpio/gpio-lp873x.c
@@ -156,7 +156,7 @@ static int lp873x_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id lp873x_gpio_id_table[] = {
- { "lp873x-gpio", },
+ { .name = "lp873x-gpio" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, lp873x_gpio_id_table);
diff --git a/drivers/gpio/gpio-lp87565.c b/drivers/gpio/gpio-lp87565.c
index 0f337c1283b2..3ac78f2b0fa7 100644
--- a/drivers/gpio/gpio-lp87565.c
+++ b/drivers/gpio/gpio-lp87565.c
@@ -171,7 +171,7 @@ static int lp87565_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id lp87565_gpio_id_table[] = {
- { "lp87565-q1-gpio", },
+ { .name = "lp87565-q1-gpio" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, lp87565_gpio_id_table);
diff --git a/drivers/gpio/gpio-max77759.c b/drivers/gpio/gpio-max77759.c
index 3bf9f23d1532..c6bdac7fb44a 100644
--- a/drivers/gpio/gpio-max77759.c
+++ b/drivers/gpio/gpio-max77759.c
@@ -502,7 +502,7 @@ static const struct of_device_id max77759_gpio_of_id[] = {
MODULE_DEVICE_TABLE(of, max77759_gpio_of_id);
static const struct platform_device_id max77759_gpio_platform_id[] = {
- { "max77759-gpio", },
+ { .name = "max77759-gpio" },
{ }
};
MODULE_DEVICE_TABLE(platform, max77759_gpio_platform_id);
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 664cf1eef494..5d61053e0596 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -708,15 +708,15 @@ static int pxa_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id gpio_id_table[] = {
- { "pxa25x-gpio", (unsigned long)&pxa25x_id },
- { "pxa26x-gpio", (unsigned long)&pxa26x_id },
- { "pxa27x-gpio", (unsigned long)&pxa27x_id },
- { "pxa3xx-gpio", (unsigned long)&pxa3xx_id },
- { "pxa93x-gpio", (unsigned long)&pxa93x_id },
- { "mmp-gpio", (unsigned long)&mmp_id },
- { "mmp2-gpio", (unsigned long)&mmp2_id },
- { "pxa1928-gpio", (unsigned long)&pxa1928_id },
- { },
+ { .name = "pxa25x-gpio", .driver_data = (unsigned long)&pxa25x_id },
+ { .name = "pxa26x-gpio", .driver_data = (unsigned long)&pxa26x_id },
+ { .name = "pxa27x-gpio", .driver_data = (unsigned long)&pxa27x_id },
+ { .name = "pxa3xx-gpio", .driver_data = (unsigned long)&pxa3xx_id },
+ { .name = "pxa93x-gpio", .driver_data = (unsigned long)&pxa93x_id },
+ { .name = "mmp-gpio", .driver_data = (unsigned long)&mmp_id },
+ { .name = "mmp2-gpio", .driver_data = (unsigned long)&mmp2_id },
+ { .name = "pxa1928-gpio", .driver_data = (unsigned long)&pxa1928_id },
+ { }
};
static struct platform_driver pxa_gpio_driver = {
diff --git a/drivers/gpio/gpio-tps65086.c b/drivers/gpio/gpio-tps65086.c
index df770ecf28bc..f29d8485ab33 100644
--- a/drivers/gpio/gpio-tps65086.c
+++ b/drivers/gpio/gpio-tps65086.c
@@ -91,7 +91,7 @@ static int tps65086_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id tps65086_gpio_id_table[] = {
- { "tps65086-gpio", },
+ { .name = "tps65086-gpio" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps65086_gpio_id_table);
diff --git a/drivers/gpio/gpio-tps65218.c b/drivers/gpio/gpio-tps65218.c
index 3b4c41f5ef55..bf85663349fb 100644
--- a/drivers/gpio/gpio-tps65218.c
+++ b/drivers/gpio/gpio-tps65218.c
@@ -201,7 +201,7 @@ static const struct of_device_id tps65218_dt_match[] = {
MODULE_DEVICE_TABLE(of, tps65218_dt_match);
static const struct platform_device_id tps65218_gpio_id_table[] = {
- { "tps65218-gpio", },
+ { .name = "tps65218-gpio" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps65218_gpio_id_table);
diff --git a/drivers/gpio/gpio-tps65219.c b/drivers/gpio/gpio-tps65219.c
index 158f63bcf10c..457fd8a589e8 100644
--- a/drivers/gpio/gpio-tps65219.c
+++ b/drivers/gpio/gpio-tps65219.c
@@ -249,8 +249,8 @@ static int tps65219_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id tps6521x_gpio_id_table[] = {
- { "tps65214-gpio", TPS65214 },
- { "tps65219-gpio", TPS65219 },
+ { .name = "tps65214-gpio", .driver_data = TPS65214 },
+ { .name = "tps65219-gpio", .driver_data = TPS65219 },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps6521x_gpio_id_table);
diff --git a/drivers/gpio/gpio-tps65912.c b/drivers/gpio/gpio-tps65912.c
index 7a2c5685c2fd..cf3fa49a7097 100644
--- a/drivers/gpio/gpio-tps65912.c
+++ b/drivers/gpio/gpio-tps65912.c
@@ -115,7 +115,7 @@ static int tps65912_gpio_probe(struct platform_device *pdev)
}
static const struct platform_device_id tps65912_gpio_id_table[] = {
- { "tps65912-gpio", },
+ { .name = "tps65912-gpio" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps65912_gpio_id_table);
diff --git a/drivers/gpio/gpio-ts5500.c b/drivers/gpio/gpio-ts5500.c
index 3c7f2efe10fd..8583931a9fb8 100644
--- a/drivers/gpio/gpio-ts5500.c
+++ b/drivers/gpio/gpio-ts5500.c
@@ -422,10 +422,10 @@ static void ts5500_dio_remove(struct platform_device *pdev)
}
static const struct platform_device_id ts5500_dio_ids[] = {
- { "ts5500-dio1", TS5500_DIO1 },
- { "ts5500-dio2", TS5500_DIO2 },
- { "ts5500-dio-lcd", TS5500_LCD },
- { "ts5600-dio-lcd", TS5600_LCD },
+ { .name = "ts5500-dio1", .driver_data = TS5500_DIO1 },
+ { .name = "ts5500-dio2", .driver_data = TS5500_DIO2 },
+ { .name = "ts5500-dio-lcd", .driver_data = TS5500_LCD },
+ { .name = "ts5600-dio-lcd", .driver_data = TS5600_LCD },
{ }
};
MODULE_DEVICE_TABLE(platform, ts5500_dio_ids);
--
2.47.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v1 3/3] gpio: max77620: Unify usage of space and comma in platform_device_id array
2026-05-27 14:57 [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-27 14:57 ` [PATCH v1 1/3] gpio: cros-ec: Drop unused assignment of platform_device_id driver data Uwe Kleine-König (The Capable Hub)
2026-05-27 14:57 ` [PATCH v1 2/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-05-27 14:57 ` Uwe Kleine-König (The Capable Hub)
2026-05-28 6:05 ` Uwe Kleine-König
2026-05-27 20:20 ` [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Linus Walleij
2026-05-28 8:47 ` Bartosz Golaszewski
4 siblings, 1 reply; 10+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-27 14:57 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: linux-gpio, linux-kernel, Uwe Kleine-König
The most accepted style for the array terminator is to use a single
space between the curly braces and no trailing comma.
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
---
drivers/gpio/gpio-max77620.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
index e6c85411c695..2bf3b55a61b5 100644
--- a/drivers/gpio/gpio-max77620.c
+++ b/drivers/gpio/gpio-max77620.c
@@ -367,7 +367,7 @@ static int max77620_gpio_probe(struct platform_device *pdev)
static const struct platform_device_id max77620_gpio_devtype[] = {
{ .name = "max77620-gpio", },
{ .name = "max20024-gpio", },
- {},
+ { }
};
MODULE_DEVICE_TABLE(platform, max77620_gpio_devtype);
--
2.47.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays
2026-05-27 14:57 [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
` (2 preceding siblings ...)
2026-05-27 14:57 ` [PATCH v1 3/3] gpio: max77620: Unify usage of space and comma in platform_device_id array Uwe Kleine-König (The Capable Hub)
@ 2026-05-27 20:20 ` Linus Walleij
2026-05-28 8:47 ` Bartosz Golaszewski
4 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2026-05-27 20:20 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Bartosz Golaszewski, Benson Leung, Guenter Roeck, linux-gpio,
chrome-platform, linux-kernel, Laurent Pinchart, Matti Vaittinen,
Marek Vasut, André Draszik, Robert Jarzmik, Aaro Koskinen,
Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren,
linux-pwm, linux-renesas-soc, linux-omap
On Wed, May 27, 2026 at 4:57 PM Uwe Kleine-König (The Capable Hub)
<u.kleine-koenig@baylibre.com> wrote:
> this series targets to use named initializers for platform_device_id
> arrays. In general these are better readable for humans and more robust
> to changes in the respective struct definition.
The series:
Reviewed-by: Linus Walleij <linusw@kernel.org>
I agree with the goal of these patch series and the end
result makes the kernel a better place.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 1/3] gpio: cros-ec: Drop unused assignment of platform_device_id driver data
2026-05-27 14:57 ` [PATCH v1 1/3] gpio: cros-ec: Drop unused assignment of platform_device_id driver data Uwe Kleine-König (The Capable Hub)
@ 2026-05-28 2:20 ` Tzung-Bi Shih
0 siblings, 0 replies; 10+ messages in thread
From: Tzung-Bi Shih @ 2026-05-28 2:20 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Linus Walleij, Bartosz Golaszewski, Benson Leung, Guenter Roeck,
linux-gpio, chrome-platform, linux-kernel
On Wed, May 27, 2026 at 04:57:27PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> The driver explicitly set the .driver_data member of struct
> platform_device_id to zero without relying on that value. Drop this
> unused assignments.
>
> While touching this array unify spacing and use named initializers for
> .name.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 3/3] gpio: max77620: Unify usage of space and comma in platform_device_id array
2026-05-27 14:57 ` [PATCH v1 3/3] gpio: max77620: Unify usage of space and comma in platform_device_id array Uwe Kleine-König (The Capable Hub)
@ 2026-05-28 6:05 ` Uwe Kleine-König
0 siblings, 0 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2026-05-28 6:05 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski; +Cc: linux-gpio, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 570 bytes --]
Hello,
On Wed, May 27, 2026 at 04:57:29PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> The most accepted style for the array terminator is to use a single
> space between the curly braces and no trailing comma.
>
> Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
I fatfingered my S-o-b line. This is supposed to read:
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
I fixed that in my try, so if it comes to a v2, that will be fixed. But
if you apply this version, please fixup accordingly.
Sorry,
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays
2026-05-27 14:57 [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
` (3 preceding siblings ...)
2026-05-27 20:20 ` [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Linus Walleij
@ 2026-05-28 8:47 ` Bartosz Golaszewski
2026-05-28 10:09 ` Uwe Kleine-König (The Capable Hub)
4 siblings, 1 reply; 10+ messages in thread
From: Bartosz Golaszewski @ 2026-05-28 8:47 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Benson Leung,
Uwe Kleine-König (The Capable Hub)
Cc: Bartosz Golaszewski, Guenter Roeck, linux-gpio, chrome-platform,
linux-kernel, Laurent Pinchart, Matti Vaittinen, Marek Vasut,
André Draszik, Robert Jarzmik, Aaro Koskinen,
Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren,
linux-pwm, linux-renesas-soc, linux-omap
On Wed, 27 May 2026 16:57:26 +0200, Uwe Kleine-König (The Capable Hub) wrote:
> this series targets to use named initializers for platform_device_id
> arrays. In general these are better readable for humans and more robust
> to changes in the respective struct definition.
>
> This robustness is needed as I want to do
>
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -610,4 +610,7 @@ struct dmi_system_id {
> struct platform_device_id {
> char name[PLATFORM_NAME_SIZE];
> - kernel_ulong_t driver_data;
> + union {
> + kernel_ulong_t driver_data;
> + const void *driver_data_ptr;
> + };
> };
>
> [...]
I fixed your SoB as requested and fixed up patch 2/3 as one of the drivers it
touched no longer exists in my tree.
[1/3] gpio: cros-ec: Drop unused assignment of platform_device_id driver data
https://git.kernel.org/brgl/c/516e4d886941568174f46985fbb7c960c516ada9
[2/3] gpio: Use named initializers for platform_device_id arrays
https://git.kernel.org/brgl/c/2d43fb71f4ecbd10649a277e8790e7ca27acfdfe
[3/3] gpio: max77620: Unify usage of space and comma in platform_device_id array
https://git.kernel.org/brgl/c/a8754838f83a9905af516f38dd2633744a94f71a
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays
2026-05-28 8:47 ` Bartosz Golaszewski
@ 2026-05-28 10:09 ` Uwe Kleine-König (The Capable Hub)
0 siblings, 0 replies; 10+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-28 10:09 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Linus Walleij, Bartosz Golaszewski, Benson Leung, Guenter Roeck,
linux-gpio, chrome-platform, linux-kernel, Laurent Pinchart,
Matti Vaittinen, Marek Vasut, André Draszik, Robert Jarzmik,
Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
Tony Lindgren, linux-pwm, linux-renesas-soc, linux-omap
[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]
Hello Bartosz,
On Thu, May 28, 2026 at 10:47:55AM +0200, Bartosz Golaszewski wrote:
> On Wed, 27 May 2026 16:57:26 +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > this series targets to use named initializers for platform_device_id
> > arrays. In general these are better readable for humans and more robust
> > to changes in the respective struct definition.
> >
> > This robustness is needed as I want to do
> >
> > diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> > --- a/include/linux/mod_devicetable.h
> > +++ b/include/linux/mod_devicetable.h
> > @@ -610,4 +610,7 @@ struct dmi_system_id {
> > struct platform_device_id {
> > char name[PLATFORM_NAME_SIZE];
> > - kernel_ulong_t driver_data;
> > + union {
> > + kernel_ulong_t driver_data;
> > + const void *driver_data_ptr;
> > + };
> > };
> >
> > [...]
>
> I fixed your SoB as requested and fixed up patch 2/3 as one of the drivers it
> touched no longer exists in my tree.
Right, I noticed that conflict when rebasing my stack to next-20260527
and assumed you'd cope for that.
Thanks!
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v1 2/3] gpio: Use named initializers for platform_device_id arrays
2026-05-27 14:57 ` [PATCH v1 2/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-05-29 7:57 ` Matti Vaittinen
0 siblings, 0 replies; 10+ messages in thread
From: Matti Vaittinen @ 2026-05-29 7:57 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Linus Walleij, Bartosz Golaszewski, Laurent Pinchart, Marek Vasut,
André Draszik, Robert Jarzmik, Aaro Koskinen,
Andreas Kemnade, Kevin Hilman, Roger Quadros, Tony Lindgren,
linux-gpio, linux-pwm, linux-kernel, linux-renesas-soc,
linux-omap
ke 27.5.2026 klo 17.57 Uwe Kleine-König (The Capable Hub)
(u.kleine-koenig@baylibre.com) kirjoitti:
>
> 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 unit.
>
> While touching these arrays unify spacing and usage of commas.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
Discuss - Estimate - Plan - Report and finally accomplish this:
void do_work(int time) __attribute__ ((const));
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-05-29 7:58 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 14:57 [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-27 14:57 ` [PATCH v1 1/3] gpio: cros-ec: Drop unused assignment of platform_device_id driver data Uwe Kleine-König (The Capable Hub)
2026-05-28 2:20 ` Tzung-Bi Shih
2026-05-27 14:57 ` [PATCH v1 2/3] gpio: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-29 7:57 ` Matti Vaittinen
2026-05-27 14:57 ` [PATCH v1 3/3] gpio: max77620: Unify usage of space and comma in platform_device_id array Uwe Kleine-König (The Capable Hub)
2026-05-28 6:05 ` Uwe Kleine-König
2026-05-27 20:20 ` [PATCH v1 0/3] gpio: Use named initializers for platform_device_id arrays Linus Walleij
2026-05-28 8:47 ` Bartosz Golaszewski
2026-05-28 10:09 ` Uwe Kleine-König (The Capable Hub)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.