Skip to content

Commit 3e0569f

Browse files
committed
regulator: Merge up pending fix
One small fix didn't get sent before the merge window.
2 parents 804bf07 + bc00d9f commit 3e0569f

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

drivers/regulator/core.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5542,6 +5542,8 @@ regulator_register(struct device *dev,
55425542
goto rinse;
55435543
}
55445544
device_initialize(&rdev->dev);
5545+
dev_set_drvdata(&rdev->dev, rdev);
5546+
rdev->dev.class = &regulator_class;
55455547
spin_lock_init(&rdev->err_lock);
55465548

55475549
/*
@@ -5603,11 +5605,9 @@ regulator_register(struct device *dev,
56035605
rdev->supply_name = regulator_desc->supply_name;
56045606

56055607
/* register with sysfs */
5606-
rdev->dev.class = &regulator_class;
56075608
rdev->dev.parent = config->dev;
56085609
dev_set_name(&rdev->dev, "regulator.%lu",
56095610
(unsigned long) atomic_inc_return(&regulator_no));
5610-
dev_set_drvdata(&rdev->dev, rdev);
56115611

56125612
/* set regulator constraints */
56135613
if (init_data)
@@ -5724,15 +5724,11 @@ regulator_register(struct device *dev,
57245724
mutex_lock(&regulator_list_mutex);
57255725
regulator_ena_gpio_free(rdev);
57265726
mutex_unlock(&regulator_list_mutex);
5727-
put_device(&rdev->dev);
5728-
rdev = NULL;
57295727
clean:
57305728
if (dangling_of_gpiod)
57315729
gpiod_put(config->ena_gpiod);
5732-
if (rdev && rdev->dev.of_node)
5733-
of_node_put(rdev->dev.of_node);
5734-
kfree(rdev);
57355730
kfree(config);
5731+
put_device(&rdev->dev);
57365732
rinse:
57375733
if (dangling_cfg_gpiod)
57385734
gpiod_put(cfg->ena_gpiod);

drivers/regulator/mt6358-regulator.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct mt6358_regulator_info {
4141
.name = #vreg, \
4242
.supply_name = supply, \
4343
.of_match = of_match_ptr(match), \
44-
.ops = &mt6358_volt_range_ops, \
44+
.ops = &mt6358_buck_ops, \
4545
.type = REGULATOR_VOLTAGE, \
4646
.id = MT6358_ID_##vreg, \
4747
.owner = THIS_MODULE, \
@@ -142,7 +142,7 @@ struct mt6358_regulator_info {
142142
.name = #vreg, \
143143
.supply_name = "vsys-" match, \
144144
.of_match = of_match_ptr(match), \
145-
.ops = &mt6358_volt_range_ops, \
145+
.ops = &mt6358_buck_ops, \
146146
.type = REGULATOR_VOLTAGE, \
147147
.id = MT6366_ID_##vreg, \
148148
.owner = THIS_MODULE, \
@@ -449,7 +449,7 @@ static unsigned int mt6358_regulator_get_mode(struct regulator_dev *rdev)
449449
}
450450
}
451451

452-
static const struct regulator_ops mt6358_volt_range_ops = {
452+
static const struct regulator_ops mt6358_buck_ops = {
453453
.list_voltage = regulator_list_voltage_linear,
454454
.map_voltage = regulator_map_voltage_linear,
455455
.set_voltage_sel = regulator_set_voltage_sel_regmap,
@@ -463,6 +463,18 @@ static const struct regulator_ops mt6358_volt_range_ops = {
463463
.get_mode = mt6358_regulator_get_mode,
464464
};
465465

466+
static const struct regulator_ops mt6358_volt_range_ops = {
467+
.list_voltage = regulator_list_voltage_linear,
468+
.map_voltage = regulator_map_voltage_linear,
469+
.set_voltage_sel = regulator_set_voltage_sel_regmap,
470+
.get_voltage_sel = mt6358_get_buck_voltage_sel,
471+
.set_voltage_time_sel = regulator_set_voltage_time_sel,
472+
.enable = regulator_enable_regmap,
473+
.disable = regulator_disable_regmap,
474+
.is_enabled = regulator_is_enabled_regmap,
475+
.get_status = mt6358_get_status,
476+
};
477+
466478
static const struct regulator_ops mt6358_volt_table_ops = {
467479
.list_voltage = regulator_list_voltage_pickable_linear_range,
468480
.map_voltage = regulator_map_voltage_pickable_linear_range,

drivers/regulator/qcom-rpmh-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ static const struct rpmh_vreg_init_data pm8550ve_vreg_data[] = {
10951095
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"),
10961096
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"),
10971097
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"),
1098-
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_lv, "vdd-s4"),
1098+
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_mv, "vdd-s4"),
10991099
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"),
11001100
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_lv, "vdd-s6"),
11011101
RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525_lv, "vdd-s7"),

0 commit comments

Comments
 (0)