Skip to content

Commit 56eb000

Browse files
stephan-ghgregkh
authored andcommitted
regulator: ab8500: Remove AB8505 USB regulator
commit 99c4f70 upstream. The USB regulator was removed for AB8500 in commit 41a06aa ("regulator: ab8500: Remove USB regulator"). It was then added for AB8505 in commit 547f384 ("regulator: ab8500: add support for ab8505"). However, there was never an entry added for it in ab8505_regulator_match. This causes all regulators after it to be initialized with the wrong device tree data, eventually leading to an out-of-bounds array read. Given that it is not used anywhere in the kernel, it seems likely that similar arguments against supporting it exist for AB8505 (it is controlled by hardware). Therefore, simply remove it like for AB8500 instead of adding an entry in ab8505_regulator_match. Fixes: 547f384 ("regulator: ab8500: add support for ab8505") Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20191106173125.14496-1-stephan@gerhold.net Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6851d40 commit 56eb000

2 files changed

Lines changed: 0 additions & 18 deletions

File tree

‎drivers/regulator/ab8500.c‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -953,23 +953,6 @@ static struct ab8500_regulator_info
953953
.update_val_idle = 0x82,
954954
.update_val_normal = 0x02,
955955
},
956-
[AB8505_LDO_USB] = {
957-
.desc = {
958-
.name = "LDO-USB",
959-
.ops = &ab8500_regulator_mode_ops,
960-
.type = REGULATOR_VOLTAGE,
961-
.id = AB8505_LDO_USB,
962-
.owner = THIS_MODULE,
963-
.n_voltages = 1,
964-
.volt_table = fixed_3300000_voltage,
965-
},
966-
.update_bank = 0x03,
967-
.update_reg = 0x82,
968-
.update_mask = 0x03,
969-
.update_val = 0x01,
970-
.update_val_idle = 0x03,
971-
.update_val_normal = 0x01,
972-
},
973956
[AB8505_LDO_AUDIO] = {
974957
.desc = {
975958
.name = "LDO-AUDIO",

‎include/linux/regulator/ab8500.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ enum ab8505_regulator_id {
3737
AB8505_LDO_AUX6,
3838
AB8505_LDO_INTCORE,
3939
AB8505_LDO_ADC,
40-
AB8505_LDO_USB,
4140
AB8505_LDO_AUDIO,
4241
AB8505_LDO_ANAMIC1,
4342
AB8505_LDO_ANAMIC2,

0 commit comments

Comments
 (0)