]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: Use named initializers for platform_device_id arrays
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Wed, 27 May 2026 14:57:28 +0000 (16:57 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 28 May 2026 08:46:46 +0000 (10:46 +0200)
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: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/b8f7581e9311d5579447304ac4f2d557b29e4f9d.1779893336.git.u.kleine-koenig@baylibre.com
[Bartosz: Rebased on top of current linux-next where one of the drivers
no longer exists.]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-adp5585.c
drivers/gpio/gpio-bd72720.c
drivers/gpio/gpio-bd9571mwv.c
drivers/gpio/gpio-lp873x.c
drivers/gpio/gpio-lp87565.c
drivers/gpio/gpio-max77759.c
drivers/gpio/gpio-pxa.c
drivers/gpio/gpio-tps65086.c
drivers/gpio/gpio-tps65218.c
drivers/gpio/gpio-tps65219.c
drivers/gpio/gpio-tps65912.c

index 0fd3cc26d017baf301b33daa49367eeb1378af8c..6f10fc6460080525545ed6339e2579855a377d43 100644 (file)
@@ -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);
index d0f936ed80af34cbf240ae3f1da7b70c3f502ceb..306e234112090eb834e1c2bd02d74c3e3bb26fcc 100644 (file)
@@ -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);
 
index cc5b1746f2fe8dae2f9c6d1d4cdf7afb3cc418f1..f829fc40c02be3665becaf68f641c8ac56016d92 100644 (file)
@@ -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);
index f4413fa5a8110cd98c83f683b747c01e123b1287..0d1bd9df265a44351c6bd6bf4be5e7fc32bc090c 100644 (file)
@@ -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);
index 0f337c1283b2222df22b9877ec84e26b51541859..3ac78f2b0fa700620befb4414190264319f4585d 100644 (file)
@@ -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);
index 3bf9f23d1532848d8706f7291f59b5c20e9715a4..c6bdac7fb44a67bf5ba6c143c4d98cc94151add4 100644 (file)
@@ -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);
index 664cf1eef494cd0113306f272c5245d03dee19eb..5d61053e0596a2d9bfc89b453201d429ce0a2be4 100644 (file)
@@ -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 = {
index df770ecf28bc4d8b6772fa1c10a555676d5b8d58..f29d8485ab33116b253b2349016d4238f8a33700 100644 (file)
@@ -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);
index 3b4c41f5ef554ea82a709ed58be00b4a129a89d7..bf85663349fb588229ea8407cd05f892fd48a075 100644 (file)
@@ -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);
index 158f63bcf10cd9c426af6289cab0719e692f93c6..457fd8a589e8921e93ec72cd024b6f4f6442b1b9 100644 (file)
@@ -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);
index 7a2c5685c2fdbcc087d0a3440bcf2615c21ce1ae..cf3fa49a70974af7f6b9d42aaaeb7e65c683f6d3 100644 (file)
@@ -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);