Commit 6308f178 authored by Andrew F. Davis's avatar Andrew F. Davis Committed by Mark Brown

regulator: tps65086: Fix DT node referencing in of_parse_cb

When we check for additional DT properties in the current node we
use the device_node passed in with the configuration data, this
will not point to the correct DT node, use the one passed in
for this purpose.

Fixes: d2a2e729 ("regulator: tps65086: Add regulator driver for the TPS65086 PMIC")
Reported-by: default avatarSteven Kipisz <s-kipisz2@ti.com>
Signed-off-by: default avatarAndrew F. Davis <afd@ti.com>
Tested-by: default avatarSteven Kipisz <s-kipisz2@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1c47f7c3
...@@ -162,14 +162,14 @@ static struct tps65086_regulator regulators[] = { ...@@ -162,14 +162,14 @@ static struct tps65086_regulator regulators[] = {
TPS65086_SWITCH("VTT", "vtt", VTT, TPS65086_SWVTT_EN, BIT(4)), TPS65086_SWITCH("VTT", "vtt", VTT, TPS65086_SWVTT_EN, BIT(4)),
}; };
static int tps65086_of_parse_cb(struct device_node *dev, static int tps65086_of_parse_cb(struct device_node *node,
const struct regulator_desc *desc, const struct regulator_desc *desc,
struct regulator_config *config) struct regulator_config *config)
{ {
int ret; int ret;
/* Check for 25mV step mode */ /* Check for 25mV step mode */
if (of_property_read_bool(config->of_node, "ti,regulator-step-size-25mv")) { if (of_property_read_bool(node, "ti,regulator-step-size-25mv")) {
switch (desc->id) { switch (desc->id) {
case BUCK1: case BUCK1:
case BUCK2: case BUCK2:
...@@ -193,7 +193,7 @@ static int tps65086_of_parse_cb(struct device_node *dev, ...@@ -193,7 +193,7 @@ static int tps65086_of_parse_cb(struct device_node *dev,
} }
/* Check for decay mode */ /* Check for decay mode */
if (desc->id <= BUCK6 && of_property_read_bool(config->of_node, "ti,regulator-decay")) { if (desc->id <= BUCK6 && of_property_read_bool(node, "ti,regulator-decay")) {
ret = regmap_write_bits(config->regmap, ret = regmap_write_bits(config->regmap,
regulators[desc->id].decay_reg, regulators[desc->id].decay_reg,
regulators[desc->id].decay_mask, regulators[desc->id].decay_mask,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment