Skip to content

Commit

Permalink
regulator: max14577: Fix invalid return value on DT parse success
Browse files Browse the repository at this point in the history
This fixes bug introduced in 667a6b7 (regulator: max14577: Add missing
of_node_put). The DTS parsing function returned number of matched
regulators as success status which then was compared against 0 in probe.

Result was a probe fail after successful parsing the DTS:
max14577-regulator: probe of max14577-regulator failed with error 2

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviwed-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Krzysztof Kozlowski authored and Mark Brown committed Feb 22, 2014
1 parent 6d0abec commit 08221fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/regulator/max14577.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ static int max14577_regulator_dt_parse_pdata(struct platform_device *pdev)

ret = of_regulator_match(&pdev->dev, np, max14577_regulator_matches,
MAX14577_REG_MAX);
if (ret < 0) {
if (ret < 0)
dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", ret);
}
else
ret = 0;

of_node_put(np);

Expand Down

0 comments on commit 08221fc

Please sign in to comment.