regulator: Rework i2c_device_id initialisation
Subsystems (12)
v4 cover regulator: Rework i2c_device_id initialisation
Hello,
changes since v2
(https://lore.kernel.org/lkml/[email protected]):
- rebase to next/master
This fixes a merge conflict and also shifts a bit which drivers are adapted in the different patches
- patch #3 is new
Best regards
Uwe
Uwe Kleine-König (The Capable Hub) (3):
regulator: Drop unused i2c driver data
regulator: Use named initializers for arrays of i2c_device_data
regulator: Improve style of i2c_device_id arrays
drivers/regulator/88pg86x.c | 4 ++-- drivers/regulator/act8865-regulator.c | 2 +- drivers/regulator/ad5398.c | 4 ++-- drivers/regulator/adp5055-regulator.c | 4 ++-- drivers/regulator/aw37503-regulator.c | 4 ++-- drivers/regulator/da9121-regulator.c | 20 ++++++++++---------- drivers/regulator/da9210-regulator.c | 4 ++-- drivers/regulator/da9211-regulator.c | 18 +++++++++--------- drivers/regulator/fan53880.c | 4 ++-- drivers/regulator/isl6271a-regulator.c | 2 +- drivers/regulator/isl9305.c | 4 ++-- drivers/regulator/lp3971.c | 2 +- drivers/regulator/lp3972.c | 2 +- drivers/regulator/lp872x.c | 4 ++-- drivers/regulator/lp8755.c | 4 ++-- drivers/regulator/ltc3589.c | 6 +++--- drivers/regulator/ltc3676.c | 2 +- drivers/regulator/max1586.c | 2 +- drivers/regulator/max20086-regulator.c | 8 ++++---- drivers/regulator/max20411-regulator.c | 2 +- drivers/regulator/max77503-regulator.c | 2 +- drivers/regulator/max77675-regulator.c | 2 +- drivers/regulator/max77826-regulator.c | 2 +- drivers/regulator/max77838-regulator.c | 2 +- drivers/regulator/max77857-regulator.c | 8 ++++---- drivers/regulator/max8649.c | 2 +- drivers/regulator/max8893.c | 2 +- drivers/regulator/max8952.c | 2 +- drivers/regulator/max8973-regulator.c | 6 +++--- drivers/regulator/mcp16502.c | 2 +- drivers/regulator/mp5416.c | 6 +++--- drivers/regulator/mp8859.c | 4 ++-- drivers/regulator/mp886x.c | 6 +++--- drivers/regulator/mpq7920.c | 4 ++-- drivers/regulator/mt6311-regulator.c | 4 ++-- drivers/regulator/pf530x-regulator.c | 8 ++++---- drivers/regulator/pf8x00-regulator.c | 8 ++++---- drivers/regulator/pv88060-regulator.c | 4 ++-- drivers/regulator/pv88080-regulator.c | 8 ++++---- drivers/regulator/pv88090-regulator.c | 4 ++-- drivers/regulator/sgm3804-regulator.c | 2 +- drivers/regulator/slg51000-regulator.c | 4 ++-- drivers/regulator/sy8106a-regulator.c | 2 +- drivers/regulator/sy8824x.c | 8 ++++---- drivers/regulator/sy8827n.c | 4 ++-- drivers/regulator/tps51632-regulator.c | 4 ++-- drivers/regulator/tps62360-regulator.c | 10 +++++----- drivers/regulator/tps6286x-regulator.c | 10 +++++----- drivers/regulator/tps6287x-regulator.c | 10 +++++----- drivers/regulator/tps65023-regulator.c | 6 +++--- drivers/regulator/tps65132-regulator.c | 4 ++-- 51 files changed, 126 insertions(+), 126 deletions(-)
base-commit: 7de6ae9e12207ec146f2f3f1e58d1a99317e88bc
Signature · 1 line
2.47.3
PATCH v4 1/3 regulator: Drop unused i2c driver data
The two drivers explicitly set .driver_data to zero but don't use this value. So drop the explicit assignment.
While touching these arrays, unify usage of whitespace and commas, and use named initializers.
--- drivers/regulator/max77675-regulator.c | 2 +- drivers/regulator/pf530x-regulator.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/regulator/max77675-regulator.c +1 -1
@@ -1028,7 +1028,7 @@ static int max77675_regulator_probe(struct i2c_client *client) }static const struct i2c_device_id max77675_i2c_id[] = { - {"max77675" ,0 }, + { .name ="max77675" }, { } };MODULE_DEVICE_TABLE (i2c, max77675_i2c_id);
drivers/regulator/pf530x-regulator.c +4 -4
@@ -353,10 +353,10 @@ static const struct of_device_id pf530x_dt_ids[] = {MODULE_DEVICE_TABLE (of, pf530x_dt_ids);static const struct i2c_device_id pf530x_i2c_id[] = { - {"pf5300" ,0 }, - {"pf5301" ,0 }, - {"pf5302" ,0 }, - {}, + { .name ="pf5300" }, + { .name ="pf5301" }, + { .name ="pf5302" }, + { } };MODULE_DEVICE_TABLE (i2c, pf530x_i2c_id);
Signature · 1 line
2.47.3
PATCH v4 2/3 regulator: Use named initializers for arrays of i2c_device_data
In reply to Uwe Kleine-König (The Capable Hub)While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.
The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union.
While touching all these arrays, unify usage of whitespace and commas.
This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds.
--- drivers/regulator/88pg86x.c | 4 ++-- drivers/regulator/ad5398.c | 4 ++-- drivers/regulator/da9121-regulator.c | 20 ++++++++++---------- drivers/regulator/da9210-regulator.c | 4 ++-- drivers/regulator/da9211-regulator.c | 18 +++++++++--------- drivers/regulator/fan53880.c | 4 ++-- drivers/regulator/isl9305.c | 4 ++-- drivers/regulator/lp3971.c | 2 +- drivers/regulator/lp3972.c | 2 +- drivers/regulator/lp872x.c | 4 ++-- drivers/regulator/lp8755.c | 4 ++-- drivers/regulator/ltc3589.c | 6 +++--- drivers/regulator/ltc3676.c | 2 +- drivers/regulator/max1586.c | 2 +- drivers/regulator/max20086-regulator.c | 8 ++++---- drivers/regulator/max20411-regulator.c | 2 +- drivers/regulator/max77503-regulator.c | 2 +- drivers/regulator/max77826-regulator.c | 2 +- drivers/regulator/max77838-regulator.c | 2 +- drivers/regulator/max77857-regulator.c | 8 ++++---- drivers/regulator/max8649.c | 2 +- drivers/regulator/max8893.c | 2 +- drivers/regulator/max8952.c | 2 +- drivers/regulator/mcp16502.c | 2 +- drivers/regulator/mp5416.c | 6 +++--- drivers/regulator/mp8859.c | 4 ++-- drivers/regulator/mp886x.c | 6 +++--- drivers/regulator/mpq7920.c | 4 ++-- drivers/regulator/mt6311-regulator.c | 4 ++-- drivers/regulator/pf8x00-regulator.c | 8 ++++---- drivers/regulator/pv88060-regulator.c | 4 ++-- drivers/regulator/pv88080-regulator.c | 8 ++++---- drivers/regulator/pv88090-regulator.c | 4 ++-- drivers/regulator/sgm3804-regulator.c | 2 +- drivers/regulator/slg51000-regulator.c | 4 ++-- drivers/regulator/sy8106a-regulator.c | 2 +- drivers/regulator/sy8824x.c | 8 ++++---- drivers/regulator/sy8827n.c | 4 ++-- drivers/regulator/tps6286x-regulator.c | 10 +++++----- drivers/regulator/tps6287x-regulator.c | 10 +++++----- 40 files changed, 100 insertions(+), 100 deletions(-)
drivers/regulator/88pg86x.c +2 -2
@@ -92,8 +92,8 @@ static const struct of_device_id __maybe_unused pg86x_dt_ids[] = {MODULE_DEVICE_TABLE (of, pg86x_dt_ids);static const struct i2c_device_id pg86x_i2c_id[] = { - {"88pg867" , }, - {"88pg868" , }, + { .name ="88pg867" }, + { .name ="88pg868" }, { } };MODULE_DEVICE_TABLE (i2c, pg86x_i2c_id);
drivers/regulator/ad5398.c +2 -2
@@ -207,8 +207,8 @@ struct ad5398_current_data_format {static const struct ad5398_current_data_format df_10_4_120 = {10 ,4 ,0 ,120000 };static const struct i2c_device_id ad5398_id[] = { - {"ad5398" , (kernel_ulong_t)&df_10_4_120 }, - {"ad5821" , (kernel_ulong_t)&df_10_4_120 }, + { .name ="ad5398" , .driver_data = (kernel_ulong_t)&df_10_4_120 }, + { .name ="ad5821" , .driver_data = (kernel_ulong_t)&df_10_4_120 }, { } };MODULE_DEVICE_TABLE (i2c, ad5398_id);
drivers/regulator/da9121-regulator.c +10 -10
@@ -1195,16 +1195,16 @@ static void da9121_i2c_remove(struct i2c_client *i2c) }static const struct i2c_device_id da9121_i2c_id[] = { - {"da9121" ,DA9121_SUBTYPE_DA9121 }, - {"da9130" ,DA9121_SUBTYPE_DA9130 }, - {"da9217" ,DA9121_SUBTYPE_DA9217 }, - {"da9122" ,DA9121_SUBTYPE_DA9122 }, - {"da9131" ,DA9121_SUBTYPE_DA9131 }, - {"da9220" ,DA9121_SUBTYPE_DA9220 }, - {"da9132" ,DA9121_SUBTYPE_DA9132 }, - {"da9141" ,DA9121_SUBTYPE_DA9141 }, - {"da9142" ,DA9121_SUBTYPE_DA9142 }, - {}, + { .name ="da9121" , .driver_data =DA9121_SUBTYPE_DA9121 }, + { .name ="da9130" , .driver_data =DA9121_SUBTYPE_DA9130 }, + { .name ="da9217" , .driver_data =DA9121_SUBTYPE_DA9217 }, + { .name ="da9122" , .driver_data =DA9121_SUBTYPE_DA9122 }, + { .name ="da9131" , .driver_data =DA9121_SUBTYPE_DA9131 }, + { .name ="da9220" , .driver_data =DA9121_SUBTYPE_DA9220 }, + { .name ="da9132" , .driver_data =DA9121_SUBTYPE_DA9132 }, + { .name ="da9141" , .driver_data =DA9121_SUBTYPE_DA9141 }, + { .name ="da9142" , .driver_data =DA9121_SUBTYPE_DA9142 }, + { } };MODULE_DEVICE_TABLE (i2c, da9121_i2c_id);
drivers/regulator/da9210-regulator.c +2 -2
@@ -202,8 +202,8 @@ static int da9210_i2c_probe(struct i2c_client *i2c) }static const struct i2c_device_id da9210_i2c_id[] = { - {"da9210" }, - {} + { .name ="da9210" }, + { } };MODULE_DEVICE_TABLE (i2c, da9210_i2c_id);
drivers/regulator/da9211-regulator.c +9 -9
@@ -522,15 +522,15 @@ static int da9211_i2c_probe(struct i2c_client *i2c) }static const struct i2c_device_id da9211_i2c_id[] = { - {"da9211" ,DA9211 }, - {"da9212" ,DA9212 }, - {"da9213" ,DA9213 }, - {"da9223" ,DA9223 }, - {"da9214" ,DA9214 }, - {"da9224" ,DA9224 }, - {"da9215" ,DA9215 }, - {"da9225" ,DA9225 }, - {}, + { .name ="da9211" , .driver_data =DA9211 }, + { .name ="da9212" , .driver_data =DA9212 }, + { .name ="da9213" , .driver_data =DA9213 }, + { .name ="da9223" , .driver_data =DA9223 }, + { .name ="da9214" , .driver_data =DA9214 }, + { .name ="da9224" , .driver_data =DA9224 }, + { .name ="da9215" , .driver_data =DA9215 }, + { .name ="da9225" , .driver_data =DA9225 }, + { } };MODULE_DEVICE_TABLE (i2c, da9211_i2c_id);
drivers/regulator/fan53880.c +2 -2
@@ -164,8 +164,8 @@ static const struct of_device_id fan53880_dt_ids[] = {MODULE_DEVICE_TABLE (of, fan53880_dt_ids);static const struct i2c_device_id fan53880_i2c_id[] = { - {"fan53880" , }, - {} + { .name ="fan53880" }, + { } };MODULE_DEVICE_TABLE (i2c, fan53880_i2c_id);
drivers/regulator/isl9305.c +2 -2
@@ -186,8 +186,8 @@ MODULE_DEVICE_TABLE(of, isl9305_dt_ids);#endif static const struct i2c_device_id isl9305_i2c_id[] = { - {"isl9305" , }, - {"isl9305h" , }, + { .name ="isl9305" }, + { .name ="isl9305h" }, { } };MODULE_DEVICE_TABLE (i2c, isl9305_i2c_id);
drivers/regulator/lp3971.c +1 -1
@@ -439,7 +439,7 @@ static int lp3971_i2c_probe(struct i2c_client *i2c) }static const struct i2c_device_id lp3971_i2c_id[] = { - {"lp3971" }, + { .name ="lp3971" }, { } };MODULE_DEVICE_TABLE (i2c, lp3971_i2c_id);
drivers/regulator/lp3972.c +1 -1
@@ -537,7 +537,7 @@ static int lp3972_i2c_probe(struct i2c_client *i2c) }static const struct i2c_device_id lp3972_i2c_id[] = { - {"lp3972" }, + { .name ="lp3972" }, { } };MODULE_DEVICE_TABLE (i2c, lp3972_i2c_id);
drivers/regulator/lp872x.c +2 -2
@@ -935,8 +935,8 @@ static const struct of_device_id lp872x_dt_ids[] __maybe_unused = {MODULE_DEVICE_TABLE (of, lp872x_dt_ids);static const struct i2c_device_id lp872x_ids[] = { - {"lp8720" ,LP8720 }, - {"lp8725" ,LP8725 }, + { .name ="lp8720" , .driver_data =LP8720 }, + { .name ="lp8725" , .driver_data =LP8725 }, { } };MODULE_DEVICE_TABLE (i2c, lp872x_ids);
drivers/regulator/lp8755.c +2 -2
@@ -430,8 +430,8 @@ static void lp8755_remove(struct i2c_client *client) }static const struct i2c_device_id lp8755_id[] = { - {LP8755_NAME }, - {} + { .name =LP8755_NAME }, + { } };MODULE_DEVICE_TABLE (i2c, lp8755_id);
drivers/regulator/ltc3589.c +3 -3
@@ -445,9 +445,9 @@ static const struct ltc3589_info ltc3589_12_info = { };static const struct i2c_device_id ltc3589_i2c_id[] = { - {"ltc3589" , (kernel_ulong_t)<c3589_info }, - {"ltc3589-1" , (kernel_ulong_t)<c3589_12_info }, - {"ltc3589-2" , (kernel_ulong_t)<c3589_12_info }, + { .name ="ltc3589" , .driver_data = (kernel_ulong_t)<c3589_info }, + { .name ="ltc3589-1" , .driver_data = (kernel_ulong_t)<c3589_12_info }, + { .name ="ltc3589-2" , .driver_data = (kernel_ulong_t)<c3589_12_info }, { } };MODULE_DEVICE_TABLE (i2c, ltc3589_i2c_id);
drivers/regulator/ltc3676.c +1 -1
@@ -357,7 +357,7 @@ static int ltc3676_regulator_probe(struct i2c_client *client) }static const struct i2c_device_id ltc3676_i2c_id[] = { - {"ltc3676" }, + { .name ="ltc3676" }, { } };MODULE_DEVICE_TABLE (i2c, ltc3676_i2c_id);
drivers/regulator/max1586.c +1 -1
@@ -276,7 +276,7 @@ static int max1586_pmic_probe(struct i2c_client *client) }static const struct i2c_device_id max1586_id[] = { - {"max1586" }, + { .name ="max1586" }, { } };MODULE_DEVICE_TABLE (i2c, max1586_id);
drivers/regulator/max20086-regulator.c +4 -4
@@ -301,10 +301,10 @@ static const struct max20086_chip_info max20089_chip_info = { };static const struct i2c_device_id max20086_i2c_id[] = { - {"max20086" , (kernel_ulong_t)&max20086_chip_info }, - {"max20087" , (kernel_ulong_t)&max20087_chip_info }, - {"max20088" , (kernel_ulong_t)&max20088_chip_info }, - {"max20089" , (kernel_ulong_t)&max20089_chip_info }, + { .name ="max20086" , .driver_data = (kernel_ulong_t)&max20086_chip_info }, + { .name ="max20087" , .driver_data = (kernel_ulong_t)&max20087_chip_info }, + { .name ="max20088" , .driver_data = (kernel_ulong_t)&max20088_chip_info }, + { .name ="max20089" , .driver_data = (kernel_ulong_t)&max20089_chip_info }, {/* Sentinel */ } };MODULE_DEVICE_TABLE (i2c, max20086_i2c_id);
drivers/regulator/max20411-regulator.c +1 -1
@@ -145,7 +145,7 @@ static const struct of_device_id of_max20411_match_tbl[] = {MODULE_DEVICE_TABLE (of, of_max20411_match_tbl);static const struct i2c_device_id max20411_id[] = { - {"max20411" }, + { .name ="max20411" }, { } };MODULE_DEVICE_TABLE (i2c, max20411_id);
drivers/regulator/max77503-regulator.c +1 -1
@@ -107,7 +107,7 @@ static const struct of_device_id of_max77503_match_tbl[] = {MODULE_DEVICE_TABLE (of, of_max77503_match_tbl);static const struct i2c_device_id max77503_regulator_id[] = { - {"max77503" }, + { .name ="max77503" }, { } };
drivers/regulator/max77826-regulator.c +1 -1
@@ -278,7 +278,7 @@ static const struct of_device_id __maybe_unused max77826_of_match[] = {MODULE_DEVICE_TABLE (of, max77826_of_match);static const struct i2c_device_id max77826_id[] = { - {"max77826-regulator" }, + { .name ="max77826-regulator" }, {/* sentinel */ } };MODULE_DEVICE_TABLE (i2c, max77826_id);
drivers/regulator/max77838-regulator.c +1 -1
@@ -200,7 +200,7 @@ static const struct of_device_id __maybe_unused max77838_of_match[] = {MODULE_DEVICE_TABLE (of, max77838_of_match);static const struct i2c_device_id max77838_id[] = { - {"max77838-regulator" }, + { .name ="max77838-regulator" }, {/* sentinel */ } };MODULE_DEVICE_TABLE (i2c, max77838_id);
drivers/regulator/max77857-regulator.c +4 -4
@@ -428,10 +428,10 @@ static int max77857_probe(struct i2c_client *client) }static const struct i2c_device_id max77857_id[] = { - {"max77831" ,ID_MAX77831 }, - {"max77857" ,ID_MAX77857 }, - {"max77859" ,ID_MAX77859 }, - {"max77859a" ,ID_MAX77859A }, + { .name ="max77831" , .driver_data =ID_MAX77831 }, + { .name ="max77857" , .driver_data =ID_MAX77857 }, + { .name ="max77859" , .driver_data =ID_MAX77859 }, + { .name ="max77859a" , .driver_data =ID_MAX77859A }, { } };MODULE_DEVICE_TABLE (i2c, max77857_id);
drivers/regulator/max8649.c +1 -1
@@ -240,7 +240,7 @@ static int max8649_regulator_probe(struct i2c_client *client) }static const struct i2c_device_id max8649_id[] = { - {"max8649" }, + { .name ="max8649" }, { } };MODULE_DEVICE_TABLE (i2c, max8649_id);
drivers/regulator/max8893.c +1 -1
@@ -162,7 +162,7 @@ MODULE_DEVICE_TABLE(of, max8893_dt_match);#endif static const struct i2c_device_id max8893_ids[] = { - {"max8893" }, + { .name ="max8893" }, { } };MODULE_DEVICE_TABLE (i2c, max8893_ids);
drivers/regulator/max8952.c +1 -1
@@ -307,7 +307,7 @@ static int max8952_pmic_probe(struct i2c_client *client) }static const struct i2c_device_id max8952_ids[] = { - {"max8952" }, + { .name ="max8952" }, { } };MODULE_DEVICE_TABLE (i2c, max8952_ids);
drivers/regulator/mcp16502.c +1 -1
@@ -578,7 +578,7 @@ static const struct dev_pm_ops mcp16502_pm_ops = { };#endif static const struct i2c_device_id mcp16502_i2c_id[] = { - {"mcp16502" }, + { .name ="mcp16502" }, { } };MODULE_DEVICE_TABLE (i2c, mcp16502_i2c_id);
drivers/regulator/mp5416.c +3 -3
@@ -228,9 +228,9 @@ static const struct of_device_id mp5416_of_match[] = {MODULE_DEVICE_TABLE (of, mp5416_of_match);static const struct i2c_device_id mp5416_id[] = { - {"mp5416" , (kernel_ulong_t)&mp5416_regulators_desc }, - {"mp5496" , (kernel_ulong_t)&mp5496_regulators_desc }, - {} + { .name ="mp5416" , .driver_data = (kernel_ulong_t)&mp5416_regulators_desc }, + { .name ="mp5496" , .driver_data = (kernel_ulong_t)&mp5496_regulators_desc }, + { } };MODULE_DEVICE_TABLE (i2c, mp5416_id);
drivers/regulator/mp8859.c +2 -2
@@ -386,8 +386,8 @@ static const struct of_device_id mp8859_dt_id[] __maybe_unused = {MODULE_DEVICE_TABLE (of, mp8859_dt_id);static const struct i2c_device_id mp8859_i2c_id[] = { - {"mp8859" , }, - { }, + { .name ="mp8859" }, + { } };MODULE_DEVICE_TABLE (i2c, mp8859_i2c_id);
drivers/regulator/mp886x.c +3 -3
@@ -348,9 +348,9 @@ static const struct of_device_id mp886x_dt_ids[] = {MODULE_DEVICE_TABLE (of, mp886x_dt_ids);static const struct i2c_device_id mp886x_id[] = { - {"mp8867" , (kernel_ulong_t)&mp8867_ci }, - {"mp8869" , (kernel_ulong_t)&mp8869_ci }, - { }, + { .name ="mp8867" , .driver_data = (kernel_ulong_t)&mp8867_ci }, + { .name ="mp8869" , .driver_data = (kernel_ulong_t)&mp8869_ci }, + { } };MODULE_DEVICE_TABLE (i2c, mp886x_id);
drivers/regulator/mpq7920.c +2 -2
@@ -309,8 +309,8 @@ static const struct of_device_id mpq7920_of_match[] = {MODULE_DEVICE_TABLE (of, mpq7920_of_match);static const struct i2c_device_id mpq7920_id[] = { - {"mpq7920" , }, - { }, + { .name ="mpq7920" }, + { } };MODULE_DEVICE_TABLE (i2c, mpq7920_id);
drivers/regulator/mt6311-regulator.c +2 -2
@@ -133,8 +133,8 @@ static int mt6311_i2c_probe(struct i2c_client *i2c) }static const struct i2c_device_id mt6311_i2c_id[] = { - {"mt6311" }, - {} + { .name ="mt6311" }, + { } };MODULE_DEVICE_TABLE (i2c, mt6311_i2c_id);
drivers/regulator/pf8x00-regulator.c +4 -4
@@ -596,10 +596,10 @@ static const struct of_device_id pf8x00_dt_ids[] = {MODULE_DEVICE_TABLE (of, pf8x00_dt_ids);static const struct i2c_device_id pf8x00_i2c_id[] = { - {"pf8100" }, - {"pf8121a" }, - {"pf8200" }, - {} + { .name ="pf8100" }, + { .name ="pf8121a" }, + { .name ="pf8200" }, + { } };MODULE_DEVICE_TABLE (i2c, pf8x00_i2c_id);
drivers/regulator/pv88060-regulator.c +2 -2
@@ -360,8 +360,8 @@ static int pv88060_i2c_probe(struct i2c_client *i2c) }static const struct i2c_device_id pv88060_i2c_id[] = { - {"pv88060" }, - {} + { .name ="pv88060" }, + { } };MODULE_DEVICE_TABLE (i2c, pv88060_i2c_id);
drivers/regulator/pv88080-regulator.c +4 -4
@@ -522,10 +522,10 @@ static const struct of_device_id pv88080_dt_ids[] = {MODULE_DEVICE_TABLE (of, pv88080_dt_ids);static const struct i2c_device_id pv88080_i2c_id[] = { - {"pv88080" , (kernel_ulong_t)&pv88080_aa_regs }, - {"pv88080-aa" , (kernel_ulong_t)&pv88080_aa_regs }, - {"pv88080-ba" , (kernel_ulong_t)&pv88080_ba_regs }, - {} + { .name ="pv88080" , .driver_data = (kernel_ulong_t)&pv88080_aa_regs }, + { .name ="pv88080-aa" , .driver_data = (kernel_ulong_t)&pv88080_aa_regs }, + { .name ="pv88080-ba" , .driver_data = (kernel_ulong_t)&pv88080_ba_regs }, + { } };MODULE_DEVICE_TABLE (i2c, pv88080_i2c_id);
drivers/regulator/pv88090-regulator.c +2 -2
@@ -381,8 +381,8 @@ static int pv88090_i2c_probe(struct i2c_client *i2c) }static const struct i2c_device_id pv88090_i2c_id[] = { - {"pv88090" }, - {} + { .name ="pv88090" }, + { } };MODULE_DEVICE_TABLE (i2c, pv88090_i2c_id);
drivers/regulator/sgm3804-regulator.c +1 -1
@@ -285,7 +285,7 @@ static int sgm3804_probe(struct i2c_client *i2c) }static const struct i2c_device_id sgm3804_id[] = { - {"sgm3804" }, + { .name ="sgm3804" }, { } };MODULE_DEVICE_TABLE (i2c, sgm3804_id);
drivers/regulator/slg51000-regulator.c +2 -2
@@ -497,8 +497,8 @@ static int slg51000_i2c_probe(struct i2c_client *client) }static const struct i2c_device_id slg51000_i2c_id[] = { - {"slg51000" }, - {} + { .name ="slg51000" }, + { } };MODULE_DEVICE_TABLE (i2c, slg51000_i2c_id);
drivers/regulator/sy8106a-regulator.c +1 -1
@@ -130,7 +130,7 @@ static const struct of_device_id sy8106a_i2c_of_match[] = {MODULE_DEVICE_TABLE (of, sy8106a_i2c_of_match);static const struct i2c_device_id sy8106a_i2c_id[] = { - {"sy8106a" }, + { .name ="sy8106a" }, { } };MODULE_DEVICE_TABLE (i2c, sy8106a_i2c_id);
drivers/regulator/sy8824x.c +4 -4
@@ -213,10 +213,10 @@ static const struct of_device_id sy8824_dt_ids[] = {MODULE_DEVICE_TABLE (of, sy8824_dt_ids);static const struct i2c_device_id sy8824_id[] = { - {"sy8824c" , (kernel_ulong_t)&sy8824c_cfg }, - {"sy8824e" , (kernel_ulong_t)&sy8824e_cfg }, - {"sy20276" , (kernel_ulong_t)&sy20276_cfg }, - {"sy20278" , (kernel_ulong_t)&sy20278_cfg }, + { .name ="sy8824c" , .driver_data = (kernel_ulong_t)&sy8824c_cfg }, + { .name ="sy8824e" , .driver_data = (kernel_ulong_t)&sy8824e_cfg }, + { .name ="sy20276" , .driver_data = (kernel_ulong_t)&sy20276_cfg }, + { .name ="sy20278" , .driver_data = (kernel_ulong_t)&sy20278_cfg }, { } };MODULE_DEVICE_TABLE (i2c, sy8824_id);
drivers/regulator/sy8827n.c +2 -2
@@ -180,8 +180,8 @@ static const struct of_device_id sy8827n_dt_ids[] = {MODULE_DEVICE_TABLE (of, sy8827n_dt_ids);static const struct i2c_device_id sy8827n_id[] = { - {"sy8827n" , }, - { }, + { .name ="sy8827n" }, + { } };MODULE_DEVICE_TABLE (i2c, sy8827n_id);
drivers/regulator/tps6286x-regulator.c +5 -5
@@ -145,11 +145,11 @@ static int tps6286x_i2c_probe(struct i2c_client *i2c) }static const struct i2c_device_id tps6286x_i2c_id[] = { - {"tps62864" }, - {"tps62866" }, - {"tps62868" }, - {"tps62869" }, - {} + { .name ="tps62864" }, + { .name ="tps62866" }, + { .name ="tps62868" }, + { .name ="tps62869" }, + { } };MODULE_DEVICE_TABLE (i2c, tps6286x_i2c_id);
drivers/regulator/tps6287x-regulator.c +5 -5
@@ -228,11 +228,11 @@ static const struct of_device_id tps6287x_dt_ids[] = {MODULE_DEVICE_TABLE (of, tps6287x_dt_ids);static const struct i2c_device_id tps6287x_i2c_id[] = { - {"tps62870" }, - {"tps62871" }, - {"tps62872" }, - {"tps62873" }, - {} + { .name ="tps62870" }, + { .name ="tps62871" }, + { .name ="tps62872" }, + { .name ="tps62873" }, + { } };MODULE_DEVICE_TABLE (i2c, tps6287x_i2c_id);
Signature · 1 line
2.47.3
PATCH v4 3/3 regulator: Improve style of i2c_device_id arrays
In reply to Uwe Kleine-König (The Capable Hub)The two previous patches did some style improvements while adapting the i2c_device_id arrays. Adapt all the remaining regulator drivers to use the same style. That is:
- Use a comma after a initialisation value unless the closing } is in the same line.
- Don't use a comma after the list terminator.
- Use a space after the opening { and one before the closing }; a single space for an empty pair.
--- drivers/regulator/act8865-regulator.c | 2 +- drivers/regulator/adp5055-regulator.c | 4 ++-- drivers/regulator/aw37503-regulator.c | 4 ++-- drivers/regulator/isl6271a-regulator.c | 2 +- drivers/regulator/max8973-regulator.c | 6 +++--- drivers/regulator/tps51632-regulator.c | 4 ++-- drivers/regulator/tps62360-regulator.c | 10 +++++----- drivers/regulator/tps65023-regulator.c | 6 +++--- drivers/regulator/tps65132-regulator.c | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-)
drivers/regulator/act8865-regulator.c +1 -1
@@ -780,7 +780,7 @@ static const struct i2c_device_id act8865_ids[] = { { .name = "act8600", .driver_data = ACT8600 }, { .name = "act8846", .driver_data = ACT8846 }, { .name = "act8865", .driver_data = ACT8865 }, - { }, + { } };MODULE_DEVICE_TABLE (i2c, act8865_ids);
drivers/regulator/adp5055-regulator.c +2 -2
@@ -403,8 +403,8 @@ static const struct of_device_id adp5055_of_match[] = {MODULE_DEVICE_TABLE (of, adp5055_of_match);static const struct i2c_device_id adp5055_ids[] = { - { .name ="adp5055" }, - { }, + { .name ="adp5055" }, + { } };MODULE_DEVICE_TABLE (i2c, adp5055_ids);
drivers/regulator/aw37503-regulator.c +2 -2
@@ -212,8 +212,8 @@ static int aw37503_probe(struct i2c_client *client) }static const struct i2c_device_id aw37503_id[] = { - {.name ="aw37503" ,}, - {}, + { .name ="aw37503" }, + { } };MODULE_DEVICE_TABLE (i2c, aw37503_id);
drivers/regulator/isl6271a-regulator.c +1 -1
@@ -138,7 +138,7 @@ static int isl6271a_probe(struct i2c_client *i2c) }static const struct i2c_device_id isl6271a_id[] = { - { .name ="isl6271a" , }, + { .name ="isl6271a" }, { } };
drivers/regulator/max8973-regulator.c +3 -3
@@ -780,9 +780,9 @@ static int max8973_probe(struct i2c_client *client) }static const struct i2c_device_id max8973_id[] = { - {.name ="max8973" , .driver_data =MAX8973 }, - {.name ="max77621" , .driver_data =MAX77621 }, - {}, + { .name ="max8973" , .driver_data =MAX8973 }, + { .name ="max77621" , .driver_data =MAX77621 }, + { } };MODULE_DEVICE_TABLE (i2c, max8973_id);
drivers/regulator/tps51632-regulator.c +2 -2
@@ -331,8 +331,8 @@ static int tps51632_probe(struct i2c_client *client) }static const struct i2c_device_id tps51632_id[] = { - {.name ="tps51632" ,}, - {}, + { .name ="tps51632" }, + { } };MODULE_DEVICE_TABLE (i2c, tps51632_id);
drivers/regulator/tps62360-regulator.c +5 -5
@@ -476,11 +476,11 @@ static void tps62360_shutdown(struct i2c_client *client) }static const struct i2c_device_id tps62360_id[] = { - {.name ="tps62360" , .driver_data =TPS62360 }, - {.name ="tps62361" , .driver_data =TPS62361 }, - {.name ="tps62362" , .driver_data =TPS62362 }, - {.name ="tps62363" , .driver_data =TPS62363 }, - {}, + { .name ="tps62360" , .driver_data =TPS62360 }, + { .name ="tps62361" , .driver_data =TPS62361 }, + { .name ="tps62362" , .driver_data =TPS62362 }, + { .name ="tps62363" , .driver_data =TPS62363 }, + { } };MODULE_DEVICE_TABLE (i2c, tps62360_id);
drivers/regulator/tps65023-regulator.c +3 -3
@@ -319,13 +319,13 @@ MODULE_DEVICE_TABLE(of, tps65023_of_match);static const struct i2c_device_id tps_65023_id[] = { { .name ="tps65023" , - .driver_data = (kernel_ulong_t)&tps65023_drv_data + .driver_data = (kernel_ulong_t)&tps65023_drv_data, }, { .name ="tps65021" , - .driver_data = (kernel_ulong_t)&tps65021_drv_data + .driver_data = (kernel_ulong_t)&tps65021_drv_data, }, { .name ="tps65020" , - .driver_data = (kernel_ulong_t)&tps65020_drv_data + .driver_data = (kernel_ulong_t)&tps65020_drv_data, }, { }, };
drivers/regulator/tps65132-regulator.c +2 -2
@@ -262,8 +262,8 @@ static int tps65132_probe(struct i2c_client *client) }static const struct i2c_device_id tps65132_id[] = { - {.name ="tps65132" ,}, - {}, + { .name ="tps65132" }, + { } };MODULE_DEVICE_TABLE (i2c, tps65132_id);
Signature · 1 line
2.47.3
Mark Brown
maintainerQuoted 8 lines · Uwe Kleine-König (The Capable Hub)
regulator: Rework
i2c_device_idinitialisationHello,
changes since v2
(https://lore.kernel.org/lkml/[email protected]):[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.3
Thanks!
[1/3] regulator: Drop unused i2c driver data
https://git.kernel.org/broonie/regulator/c/3ac69e3cb288 [2/3] regulator: Use named initializers for arrays of i2c_device_data https://git.kernel.org/broonie/regulator/c/8e74b2db5867 [3/3] regulator: Improve style of i2c_device_id arrays https://git.kernel.org/broonie/regulator/c/2924fa8381ee
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