regulator: Use named initializers for platform_device_id arrays
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | regulator: Drop unused assignment of platform_device_id driver datadrivers/ drivers/ drivers/ +14 more | +33 | 0 replies | |
| 2/3 | regulator: Use named initializers for platform_device_id arraysdrivers/ drivers/ drivers/ +21 more | +54 | 2 replies | |
| 3/3 | regulator: Unify usage of space and comma in platform_device_id arraysdrivers/ drivers/ drivers/ +2 more | +8 | 0 replies |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by.
| Patch | Karel Balej | Matti Vaittinen |
|---|---|---|
| 1/3 | ||
| 2/3 | A-b | R-b |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 0/3] 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.
This robustness is needed as I want to do
include/linux/mod_devicetable.h +4 -1
@@ -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:
drivers/regulator/bd96801-regulator.c +6 -6
@@ -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
Signature · 1 line
2.47.3