* [PATCH v1 0/3] regulator: Use named initializers for platform_device_id arrays
@ 2026-05-27 10:47 Uwe Kleine-König (The Capable Hub)
2026-05-27 10:47 ` [PATCH v1 2/3] " Uwe Kleine-König (The Capable Hub)
2026-06-02 15:09 ` [PATCH v1 0/3] " Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-27 10:47 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Chanwoo Choi, Krzysztof Kozlowski, Javier Martinez Canillas,
Matthias Brugger, AngeloGioacchino Del Regno, André Draszik,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-samsung-soc,
Karel Balej, Matti Vaittinen, Marek Vasut, Samuel Kayode,
Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
Tony Lindgren, linux-renesas-soc, imx, linux-arm-msm, 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
index 3b0c9a251a2e..b84881f32444 100644
--- 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/regulator/bd96801-regulator.c b/drivers/regulator/bd96801-regulator.c
index 308279b31fd3..6bbad1f1ddd1 100644
--- a/drivers/regulator/bd96801-regulator.c
+++ b/drivers/regulator/bd96801-regulator.c
@@ -1211,7 +1211,7 @@ static int bd96801_probe(struct platform_device *pdev)
{
struct regulator_dev *ldo_errs_rdev_arr[BD96801_NUM_LDOS];
struct regulator_dev *all_rdevs[BD96801_NUM_REGULATORS];
- struct bd96801_pmic_data *pdata_template;
+ const struct bd96801_pmic_data *pdata_template;
struct bd96801_regulator_data *rdesc;
struct regulator_config config = {};
int ldo_errs_arr[BD96801_NUM_LDOS];
@@ -1224,7 +1224,7 @@ static int bd96801_probe(struct platform_device *pdev)
parent = pdev->dev.parent;
- pdata_template = (struct bd96801_pmic_data *)platform_get_device_id(pdev)->driver_data;
+ pdata_template = platform_get_device_id(pdev)->driver_data_ptr;
if (!pdata_template)
return -ENODEV;
@@ -1329,10 +1329,10 @@ static int bd96801_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd96801_pmic_id[] = {
- { .name = "bd96801-regulator", .driver_data = (kernel_ulong_t)&bd96801_data },
- { .name = "bd96802-regulator", .driver_data = (kernel_ulong_t)&bd96802_data },
- { .name = "bd96805-regulator", .driver_data = (kernel_ulong_t)&bd96805_data },
- { .name = "bd96806-regulator", .driver_data = (kernel_ulong_t)&bd96806_data },
+ { .name = "bd96801-regulator", .driver_data_ptr = &bd96801_data },
+ { .name = "bd96802-regulator", .driver_data_ptr = &bd96802_data },
+ { .name = "bd96805-regulator", .driver_data_ptr = &bd96805_data },
+ { .name = "bd96806-regulator", .driver_data_ptr = &bd96806_data },
{ }
};
MODULE_DEVICE_TABLE(platform, bd96801_pmic_id);
which allows the compiler to notice that driver_data is supposed to
be const and thus requires the first hunk.
If you consider the last patch mostly churn, just drop it.
Best regards
Uwe
Uwe Kleine-König (The Capable Hub) (3):
regulator: Drop unused assignment of platform_device_id driver data
regulator: Use named initializers for platform_device_id arrays
regulator: Unify usage of space and comma in platform_device_id arrays
drivers/regulator/88pm8607.c | 4 +---
drivers/regulator/88pm886-regulator.c | 2 +-
drivers/regulator/bd71815-regulator.c | 4 ++--
drivers/regulator/bd71828-regulator.c | 6 +++---
drivers/regulator/bd718x7-regulator.c | 6 +++---
drivers/regulator/bd9571mwv-regulator.c | 4 ++--
drivers/regulator/bd9576-regulator.c | 6 +++---
drivers/regulator/bd96801-regulator.c | 10 +++++-----
drivers/regulator/hi6421-regulator.c | 2 +-
drivers/regulator/hi6421v530-regulator.c | 2 +-
drivers/regulator/hi6421v600-regulator.c | 2 +-
drivers/regulator/hi655x-regulator.c | 2 +-
drivers/regulator/lp873x-regulator.c | 2 +-
drivers/regulator/lp87565-regulator.c | 4 ++--
drivers/regulator/max14577-regulator.c | 4 ++--
drivers/regulator/max77541-regulator.c | 4 ++--
drivers/regulator/max77620-regulator.c | 8 ++++----
drivers/regulator/max77686-regulator.c | 4 ++--
drivers/regulator/max77693-regulator.c | 6 +++---
drivers/regulator/max77802-regulator.c | 4 ++--
drivers/regulator/max8997-regulator.c | 4 ++--
drivers/regulator/max8998.c | 4 ++--
drivers/regulator/mt6323-regulator.c | 4 ++--
drivers/regulator/mt6331-regulator.c | 4 ++--
drivers/regulator/mt6332-regulator.c | 4 ++--
drivers/regulator/mt6357-regulator.c | 4 ++--
drivers/regulator/mt6358-regulator.c | 4 ++--
drivers/regulator/mt6359-regulator.c | 4 ++--
drivers/regulator/mt6360-regulator.c | 4 ++--
drivers/regulator/mt6370-regulator.c | 4 ++--
drivers/regulator/mt6380-regulator.c | 4 ++--
drivers/regulator/mt6397-regulator.c | 4 ++--
drivers/regulator/pf1550-regulator.c | 2 +-
drivers/regulator/qcom-pm8008-regulator.c | 2 +-
drivers/regulator/rt4831-regulator.c | 4 ++--
drivers/regulator/rt5033-regulator.c | 2 +-
drivers/regulator/rt5120-regulator.c | 4 ++--
drivers/regulator/s2dos05-regulator.c | 4 ++--
drivers/regulator/s2mpa01.c | 4 ++--
drivers/regulator/s2mps11.c | 18 +++++++++---------
drivers/regulator/s5m8767.c | 4 ++--
drivers/regulator/sy7636a-regulator.c | 2 +-
drivers/regulator/tps65086-regulator.c | 2 +-
drivers/regulator/tps65218-regulator.c | 2 +-
drivers/regulator/tps65219-regulator.c | 6 +++---
drivers/regulator/tps65912-regulator.c | 2 +-
46 files changed, 95 insertions(+), 97 deletions(-)
base-commit: e7e28506af98ce4e1059e5ec59334b335c00a246
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v1 2/3] regulator: Use named initializers for platform_device_id arrays
2026-05-27 10:47 [PATCH v1 0/3] regulator: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-05-27 10:47 ` Uwe Kleine-König (The Capable Hub)
2026-05-27 18:21 ` Karel Balej
2026-05-29 8:02 ` Matti Vaittinen
2026-06-02 15:09 ` [PATCH v1 0/3] " Mark Brown
1 sibling, 2 replies; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-27 10:47 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Karel Balej, Matti Vaittinen, Marek Vasut, Chanwoo Choi,
Krzysztof Kozlowski, Matthias Brugger, AngeloGioacchino Del Regno,
Samuel Kayode, André Draszik, Aaro Koskinen, Andreas Kemnade,
Kevin Hilman, Roger Quadros, Tony Lindgren, linux-kernel,
linux-renesas-soc, linux-arm-kernel, linux-mediatek, imx,
linux-arm-msm, linux-samsung-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/regulator/88pm886-regulator.c | 2 +-
drivers/regulator/bd71815-regulator.c | 4 ++--
drivers/regulator/bd71828-regulator.c | 6 +++---
drivers/regulator/bd718x7-regulator.c | 6 +++---
drivers/regulator/bd9571mwv-regulator.c | 4 ++--
drivers/regulator/bd9576-regulator.c | 6 +++---
drivers/regulator/bd96801-regulator.c | 10 +++++-----
drivers/regulator/lp873x-regulator.c | 2 +-
drivers/regulator/lp87565-regulator.c | 4 ++--
drivers/regulator/max14577-regulator.c | 4 ++--
drivers/regulator/max77541-regulator.c | 4 ++--
drivers/regulator/max77693-regulator.c | 6 +++---
drivers/regulator/max8998.c | 4 ++--
drivers/regulator/mt6357-regulator.c | 4 ++--
drivers/regulator/pf1550-regulator.c | 2 +-
drivers/regulator/qcom-pm8008-regulator.c | 2 +-
drivers/regulator/rt5033-regulator.c | 2 +-
drivers/regulator/s2dos05-regulator.c | 4 ++--
drivers/regulator/s2mps11.c | 18 +++++++++---------
drivers/regulator/sy7636a-regulator.c | 2 +-
drivers/regulator/tps65086-regulator.c | 2 +-
drivers/regulator/tps65218-regulator.c | 2 +-
drivers/regulator/tps65219-regulator.c | 6 +++---
drivers/regulator/tps65912-regulator.c | 2 +-
24 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/drivers/regulator/88pm886-regulator.c b/drivers/regulator/88pm886-regulator.c
index a38bd4f312b7..7328cd1cf265 100644
--- a/drivers/regulator/88pm886-regulator.c
+++ b/drivers/regulator/88pm886-regulator.c
@@ -373,7 +373,7 @@ static int pm886_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id pm886_regulator_id_table[] = {
- { "88pm886-regulator", },
+ { .name = "88pm886-regulator" },
{ }
};
MODULE_DEVICE_TABLE(platform, pm886_regulator_id_table);
diff --git a/drivers/regulator/bd71815-regulator.c b/drivers/regulator/bd71815-regulator.c
index 668714f35464..4c2b20d1b284 100644
--- a/drivers/regulator/bd71815-regulator.c
+++ b/drivers/regulator/bd71815-regulator.c
@@ -607,8 +607,8 @@ static int bd7181x_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd7181x_pmic_id[] = {
- { "bd71815-pmic", ROHM_CHIP_TYPE_BD71815 },
- { },
+ { .name = "bd71815-pmic", .driver_data = ROHM_CHIP_TYPE_BD71815 },
+ { }
};
MODULE_DEVICE_TABLE(platform, bd7181x_pmic_id);
diff --git a/drivers/regulator/bd71828-regulator.c b/drivers/regulator/bd71828-regulator.c
index 473beb4399d9..bd61caa8284a 100644
--- a/drivers/regulator/bd71828-regulator.c
+++ b/drivers/regulator/bd71828-regulator.c
@@ -1691,9 +1691,9 @@ static int bd71828_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd71828_pmic_id[] = {
- { "bd71828-pmic", ROHM_CHIP_TYPE_BD71828 },
- { "bd72720-pmic", ROHM_CHIP_TYPE_BD72720 },
- { },
+ { .name = "bd71828-pmic", .driver_data = ROHM_CHIP_TYPE_BD71828 },
+ { .name = "bd72720-pmic", .driver_data = ROHM_CHIP_TYPE_BD72720 },
+ { }
};
MODULE_DEVICE_TABLE(platform, bd71828_pmic_id);
diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c
index 1b5997c8482e..9cc29b9409d0 100644
--- a/drivers/regulator/bd718x7-regulator.c
+++ b/drivers/regulator/bd718x7-regulator.c
@@ -1816,9 +1816,9 @@ static int bd718xx_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd718x7_pmic_id[] = {
- { "bd71837-pmic", ROHM_CHIP_TYPE_BD71837 },
- { "bd71847-pmic", ROHM_CHIP_TYPE_BD71847 },
- { },
+ { .name = "bd71837-pmic", .driver_data = ROHM_CHIP_TYPE_BD71837 },
+ { .name = "bd71847-pmic", .driver_data = ROHM_CHIP_TYPE_BD71847 },
+ { }
};
MODULE_DEVICE_TABLE(platform, bd718x7_pmic_id);
diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c
index f4de24a281b1..5bf02dc0d20e 100644
--- a/drivers/regulator/bd9571mwv-regulator.c
+++ b/drivers/regulator/bd9571mwv-regulator.c
@@ -344,8 +344,8 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd9571mwv_regulator_id_table[] = {
- { "bd9571mwv-regulator", ROHM_CHIP_TYPE_BD9571 },
- { "bd9574mwf-regulator", ROHM_CHIP_TYPE_BD9574 },
+ { .name = "bd9571mwv-regulator", .driver_data = ROHM_CHIP_TYPE_BD9571 },
+ { .name = "bd9574mwf-regulator", .driver_data = ROHM_CHIP_TYPE_BD9574 },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, bd9571mwv_regulator_id_table);
diff --git a/drivers/regulator/bd9576-regulator.c b/drivers/regulator/bd9576-regulator.c
index bf5f9c3f2c97..fcdaaa56e356 100644
--- a/drivers/regulator/bd9576-regulator.c
+++ b/drivers/regulator/bd9576-regulator.c
@@ -1117,9 +1117,9 @@ static int bd957x_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd957x_pmic_id[] = {
- { "bd9573-regulator", ROHM_CHIP_TYPE_BD9573 },
- { "bd9576-regulator", ROHM_CHIP_TYPE_BD9576 },
- { },
+ { .name = "bd9573-regulator", .driver_data = ROHM_CHIP_TYPE_BD9573 },
+ { .name = "bd9576-regulator", .driver_data = ROHM_CHIP_TYPE_BD9576 },
+ { }
};
MODULE_DEVICE_TABLE(platform, bd957x_pmic_id);
diff --git a/drivers/regulator/bd96801-regulator.c b/drivers/regulator/bd96801-regulator.c
index 129b20c33bad..308279b31fd3 100644
--- a/drivers/regulator/bd96801-regulator.c
+++ b/drivers/regulator/bd96801-regulator.c
@@ -1329,11 +1329,11 @@ static int bd96801_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd96801_pmic_id[] = {
- { "bd96801-regulator", (kernel_ulong_t)&bd96801_data },
- { "bd96802-regulator", (kernel_ulong_t)&bd96802_data },
- { "bd96805-regulator", (kernel_ulong_t)&bd96805_data },
- { "bd96806-regulator", (kernel_ulong_t)&bd96806_data },
- { },
+ { .name = "bd96801-regulator", .driver_data = (kernel_ulong_t)&bd96801_data },
+ { .name = "bd96802-regulator", .driver_data = (kernel_ulong_t)&bd96802_data },
+ { .name = "bd96805-regulator", .driver_data = (kernel_ulong_t)&bd96805_data },
+ { .name = "bd96806-regulator", .driver_data = (kernel_ulong_t)&bd96806_data },
+ { }
};
MODULE_DEVICE_TABLE(platform, bd96801_pmic_id);
diff --git a/drivers/regulator/lp873x-regulator.c b/drivers/regulator/lp873x-regulator.c
index 84a134cfcd9c..7e837ddfa236 100644
--- a/drivers/regulator/lp873x-regulator.c
+++ b/drivers/regulator/lp873x-regulator.c
@@ -180,7 +180,7 @@ static int lp873x_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id lp873x_regulator_id_table[] = {
- { "lp873x-regulator", },
+ { .name = "lp873x-regulator" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, lp873x_regulator_id_table);
diff --git a/drivers/regulator/lp87565-regulator.c b/drivers/regulator/lp87565-regulator.c
index 1259b5d20153..34e7a5d323d7 100644
--- a/drivers/regulator/lp87565-regulator.c
+++ b/drivers/regulator/lp87565-regulator.c
@@ -229,8 +229,8 @@ static int lp87565_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id lp87565_regulator_id_table[] = {
- { "lp87565-regulator", },
- { "lp87565-q1-regulator", },
+ { .name = "lp87565-regulator" },
+ { .name = "lp87565-q1-regulator" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, lp87565_regulator_id_table);
diff --git a/drivers/regulator/max14577-regulator.c b/drivers/regulator/max14577-regulator.c
index 41fd15adfd1f..c9d8d5e31cbd 100644
--- a/drivers/regulator/max14577-regulator.c
+++ b/drivers/regulator/max14577-regulator.c
@@ -235,8 +235,8 @@ static int max14577_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id max14577_regulator_id[] = {
- { "max14577-regulator", MAXIM_DEVICE_TYPE_MAX14577, },
- { "max77836-regulator", MAXIM_DEVICE_TYPE_MAX77836, },
+ { .name = "max14577-regulator", .driver_data = MAXIM_DEVICE_TYPE_MAX14577 },
+ { .name = "max77836-regulator", .driver_data = MAXIM_DEVICE_TYPE_MAX77836 },
{ }
};
MODULE_DEVICE_TABLE(platform, max14577_regulator_id);
diff --git a/drivers/regulator/max77541-regulator.c b/drivers/regulator/max77541-regulator.c
index e6b3d9147c37..f2365930e9a9 100644
--- a/drivers/regulator/max77541-regulator.c
+++ b/drivers/regulator/max77541-regulator.c
@@ -133,8 +133,8 @@ static int max77541_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id max77541_regulator_platform_id[] = {
- { "max77540-regulator" },
- { "max77541-regulator" },
+ { .name = "max77540-regulator" },
+ { .name = "max77541-regulator" },
{ }
};
MODULE_DEVICE_TABLE(platform, max77541_regulator_platform_id);
diff --git a/drivers/regulator/max77693-regulator.c b/drivers/regulator/max77693-regulator.c
index 72a67d0c5f1e..a8b3a2058d34 100644
--- a/drivers/regulator/max77693-regulator.c
+++ b/drivers/regulator/max77693-regulator.c
@@ -271,9 +271,9 @@ static int max77693_pmic_probe(struct platform_device *pdev)
}
static const struct platform_device_id max77693_pmic_id[] = {
- { "max77693-pmic", TYPE_MAX77693 },
- { "max77843-regulator", TYPE_MAX77843 },
- {},
+ { .name = "max77693-pmic", .driver_data = TYPE_MAX77693 },
+ { .name = "max77843-regulator", .driver_data = TYPE_MAX77843 },
+ { }
};
MODULE_DEVICE_TABLE(platform, max77693_pmic_id);
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c
index 254a77887f66..cc85fbe8b77c 100644
--- a/drivers/regulator/max8998.c
+++ b/drivers/regulator/max8998.c
@@ -752,8 +752,8 @@ static int max8998_pmic_probe(struct platform_device *pdev)
}
static const struct platform_device_id max8998_pmic_id[] = {
- { "max8998-pmic", TYPE_MAX8998 },
- { "lp3974-pmic", TYPE_LP3974 },
+ { .name = "max8998-pmic", .driver_data = TYPE_MAX8998 },
+ { .name = "lp3974-pmic", .driver_data = TYPE_LP3974 },
{ }
};
MODULE_DEVICE_TABLE(platform, max8998_pmic_id);
diff --git a/drivers/regulator/mt6357-regulator.c b/drivers/regulator/mt6357-regulator.c
index 09feb454ab6b..815ef7d3e5be 100644
--- a/drivers/regulator/mt6357-regulator.c
+++ b/drivers/regulator/mt6357-regulator.c
@@ -431,8 +431,8 @@ static int mt6357_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id mt6357_platform_ids[] = {
- { "mt6357-regulator" },
- { /* sentinel */ },
+ { .name = "mt6357-regulator" },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, mt6357_platform_ids);
diff --git a/drivers/regulator/pf1550-regulator.c b/drivers/regulator/pf1550-regulator.c
index 1d1726528460..610eac9bb9cb 100644
--- a/drivers/regulator/pf1550-regulator.c
+++ b/drivers/regulator/pf1550-regulator.c
@@ -409,7 +409,7 @@ static int pf1550_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id pf1550_regulator_id[] = {
- { "pf1550-regulator", },
+ { .name = "pf1550-regulator" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, pf1550_regulator_id);
diff --git a/drivers/regulator/qcom-pm8008-regulator.c b/drivers/regulator/qcom-pm8008-regulator.c
index 90c78ee1c37b..9c9b8be2e15a 100644
--- a/drivers/regulator/qcom-pm8008-regulator.c
+++ b/drivers/regulator/qcom-pm8008-regulator.c
@@ -180,7 +180,7 @@ static int pm8008_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id pm8008_regulator_id_table[] = {
- { "pm8008-regulator" },
+ { .name = "pm8008-regulator" },
{ }
};
MODULE_DEVICE_TABLE(platform, pm8008_regulator_id_table);
diff --git a/drivers/regulator/rt5033-regulator.c b/drivers/regulator/rt5033-regulator.c
index 2ba74f205543..3aeab9a57871 100644
--- a/drivers/regulator/rt5033-regulator.c
+++ b/drivers/regulator/rt5033-regulator.c
@@ -116,7 +116,7 @@ static int rt5033_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id rt5033_regulator_id[] = {
- { "rt5033-regulator", },
+ { .name = "rt5033-regulator" },
{ }
};
MODULE_DEVICE_TABLE(platform, rt5033_regulator_id);
diff --git a/drivers/regulator/s2dos05-regulator.c b/drivers/regulator/s2dos05-regulator.c
index a1c394ddbaff..6e25f663496a 100644
--- a/drivers/regulator/s2dos05-regulator.c
+++ b/drivers/regulator/s2dos05-regulator.c
@@ -146,8 +146,8 @@ static int s2dos05_pmic_probe(struct platform_device *pdev)
}
static const struct platform_device_id s2dos05_pmic_id[] = {
- { "s2dos05-regulator" },
- { },
+ { .name = "s2dos05-regulator" },
+ { }
};
MODULE_DEVICE_TABLE(platform, s2dos05_pmic_id);
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 81cfd60460f8..0fb54617b8a7 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -2266,15 +2266,15 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
}
static const struct platform_device_id s2mps11_pmic_id[] = {
- { "s2mpg10-regulator", S2MPG10},
- { "s2mpg11-regulator", S2MPG11},
- { "s2mps11-regulator", S2MPS11X},
- { "s2mps13-regulator", S2MPS13X},
- { "s2mps14-regulator", S2MPS14X},
- { "s2mps15-regulator", S2MPS15X},
- { "s2mpu02-regulator", S2MPU02},
- { "s2mpu05-regulator", S2MPU05},
- { },
+ { .name = "s2mpg10-regulator", .driver_data = S2MPG10 },
+ { .name = "s2mpg11-regulator", .driver_data = S2MPG11 },
+ { .name = "s2mps11-regulator", .driver_data = S2MPS11X },
+ { .name = "s2mps13-regulator", .driver_data = S2MPS13X },
+ { .name = "s2mps14-regulator", .driver_data = S2MPS14X },
+ { .name = "s2mps15-regulator", .driver_data = S2MPS15X },
+ { .name = "s2mpu02-regulator", .driver_data = S2MPU02 },
+ { .name = "s2mpu05-regulator", .driver_data = S2MPU05 },
+ { }
};
MODULE_DEVICE_TABLE(platform, s2mps11_pmic_id);
diff --git a/drivers/regulator/sy7636a-regulator.c b/drivers/regulator/sy7636a-regulator.c
index 551647bc1052..c44c445ea139 100644
--- a/drivers/regulator/sy7636a-regulator.c
+++ b/drivers/regulator/sy7636a-regulator.c
@@ -147,7 +147,7 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id sy7636a_regulator_id_table[] = {
- { "sy7636a-regulator", },
+ { .name = "sy7636a-regulator" },
{ }
};
MODULE_DEVICE_TABLE(platform, sy7636a_regulator_id_table);
diff --git a/drivers/regulator/tps65086-regulator.c b/drivers/regulator/tps65086-regulator.c
index 2d284c64eeb7..94bf96856d10 100644
--- a/drivers/regulator/tps65086-regulator.c
+++ b/drivers/regulator/tps65086-regulator.c
@@ -399,7 +399,7 @@ static int tps65086_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id tps65086_regulator_id_table[] = {
- { "tps65086-regulator", },
+ { .name = "tps65086-regulator" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps65086_regulator_id_table);
diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index f44b5767099c..8df81ceeb845 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -341,7 +341,7 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id tps65218_regulator_id_table[] = {
- { "tps65218-regulator", },
+ { .name = "tps65218-regulator" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps65218_regulator_id_table);
diff --git a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps65219-regulator.c
index 324c3a33af8a..a667c3f44bb7 100644
--- a/drivers/regulator/tps65219-regulator.c
+++ b/drivers/regulator/tps65219-regulator.c
@@ -541,9 +541,9 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id tps65219_regulator_id_table[] = {
- { "tps65214-regulator", TPS65214 },
- { "tps65215-regulator", TPS65215 },
- { "tps65219-regulator", TPS65219 },
+ { .name = "tps65214-regulator", .driver_data = TPS65214 },
+ { .name = "tps65215-regulator", .driver_data = TPS65215 },
+ { .name = "tps65219-regulator", .driver_data = TPS65219 },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps65219_regulator_id_table);
diff --git a/drivers/regulator/tps65912-regulator.c b/drivers/regulator/tps65912-regulator.c
index 7ff7877a2e09..4317ec62f18f 100644
--- a/drivers/regulator/tps65912-regulator.c
+++ b/drivers/regulator/tps65912-regulator.c
@@ -142,7 +142,7 @@ static int tps65912_regulator_probe(struct platform_device *pdev)
}
static const struct platform_device_id tps65912_regulator_id_table[] = {
- { "tps65912-regulator", },
+ { .name = "tps65912-regulator" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, tps65912_regulator_id_table);
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 2/3] regulator: Use named initializers for platform_device_id arrays
2026-05-27 10:47 ` [PATCH v1 2/3] " Uwe Kleine-König (The Capable Hub)
@ 2026-05-27 18:21 ` Karel Balej
2026-05-29 8:02 ` Matti Vaittinen
1 sibling, 0 replies; 5+ messages in thread
From: Karel Balej @ 2026-05-27 18:21 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub), Liam Girdwood,
Mark Brown
Cc: Matti Vaittinen, Marek Vasut, Chanwoo Choi, Krzysztof Kozlowski,
Matthias Brugger, AngeloGioacchino Del Regno, Samuel Kayode,
André Draszik, Aaro Koskinen, Andreas Kemnade, Kevin Hilman,
Roger Quadros, Tony Lindgren, linux-kernel, linux-renesas-soc,
linux-arm-kernel, linux-mediatek, imx, linux-arm-msm,
linux-samsung-soc, linux-omap
Uwe Kleine-König (The Capable Hub), 2026-05-27T12:47:45+02:00:
> diff --git a/drivers/regulator/88pm886-regulator.c b/drivers/regulator/88pm886-regulator.c
> index a38bd4f312b7..7328cd1cf265 100644
> --- a/drivers/regulator/88pm886-regulator.c
> +++ b/drivers/regulator/88pm886-regulator.c
> @@ -373,7 +373,7 @@ static int pm886_regulator_probe(struct platform_device *pdev)
> }
>
> static const struct platform_device_id pm886_regulator_id_table[] = {
> - { "88pm886-regulator", },
> + { .name = "88pm886-regulator" },
> { }
> };
> MODULE_DEVICE_TABLE(platform, pm886_regulator_id_table);
Acked-by: Karel Balej <balejk@matfyz.cz> # for Marvell 88PM886
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 2/3] regulator: Use named initializers for platform_device_id arrays
2026-05-27 10:47 ` [PATCH v1 2/3] " Uwe Kleine-König (The Capable Hub)
2026-05-27 18:21 ` Karel Balej
@ 2026-05-29 8:02 ` Matti Vaittinen
1 sibling, 0 replies; 5+ messages in thread
From: Matti Vaittinen @ 2026-05-29 8:02 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Liam Girdwood, Mark Brown, Karel Balej, Marek Vasut, Chanwoo Choi,
Krzysztof Kozlowski, Matthias Brugger, AngeloGioacchino Del Regno,
Samuel Kayode, André Draszik, Aaro Koskinen, Andreas Kemnade,
Kevin Hilman, Roger Quadros, Tony Lindgren, linux-kernel,
linux-renesas-soc, linux-arm-kernel, linux-mediatek, imx,
linux-arm-msm, linux-samsung-soc, linux-omap
ke 27.5.2026 klo 13.48 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] 5+ messages in thread
* Re: [PATCH v1 0/3] regulator: Use named initializers for platform_device_id arrays
2026-05-27 10:47 [PATCH v1 0/3] regulator: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-27 10:47 ` [PATCH v1 2/3] " Uwe Kleine-König (The Capable Hub)
@ 2026-06-02 15:09 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-06-02 15:09 UTC (permalink / raw)
To: Liam Girdwood, Uwe Kleine-König (The Capable Hub)
Cc: Chanwoo Choi, Krzysztof Kozlowski, Javier Martinez Canillas,
Matthias Brugger, AngeloGioacchino Del Regno, André Draszik,
linux-kernel, linux-arm-kernel, linux-mediatek, linux-samsung-soc,
Karel Balej, Matti Vaittinen, Marek Vasut, Samuel Kayode,
Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
Tony Lindgren, linux-renesas-soc, imx, linux-arm-msm, linux-omap
On Wed, 27 May 2026 12:47:43 +0200, Uwe Kleine-König (The Capable Hub) wrote:
> regulator: Use named initializers for platform_device_id arrays
>
> 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.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.2
Thanks!
[1/3] regulator: Drop unused assignment of platform_device_id driver data
https://git.kernel.org/broonie/regulator/c/4079e9d91b40
[2/3] regulator: Use named initializers for platform_device_id arrays
https://git.kernel.org/broonie/regulator/c/d35028340d75
[3/3] regulator: Unify usage of space and comma in platform_device_id arrays
https://git.kernel.org/broonie/regulator/c/0eb17367814a
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-03 7:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 10:47 [PATCH v1 0/3] regulator: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-27 10:47 ` [PATCH v1 2/3] " Uwe Kleine-König (The Capable Hub)
2026-05-27 18:21 ` Karel Balej
2026-05-29 8:02 ` Matti Vaittinen
2026-06-02 15:09 ` [PATCH v1 0/3] " Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox