Skip to content

Commit

Permalink
regulator: lp87565: Fix probe failure for "ti,lp87565"
Browse files Browse the repository at this point in the history
The "ti,lp87565" compatible string is still in of_lp87565_match_table,
but current code will return -EINVAL because lp87565->dev_type is unknown.
This was working in earlier kernel versions, so fix it.

Fixes: 7ee63bd ("regulator: lp87565: Add 4-phase lp87561 regulator support")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20190711113517.26077-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jul 24, 2019
1 parent 27988c9 commit a853c0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/regulator/lp87565-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static int lp87565_regulator_probe(struct platform_device *pdev)
struct lp87565 *lp87565 = dev_get_drvdata(pdev->dev.parent);
struct regulator_config config = { };
struct regulator_dev *rdev;
int i, min_idx = LP87565_BUCK_0, max_idx = LP87565_BUCK_3;
int i, min_idx, max_idx;

platform_set_drvdata(pdev, lp87565);

Expand All @@ -182,9 +182,9 @@ static int lp87565_regulator_probe(struct platform_device *pdev)
max_idx = LP87565_BUCK_3210;
break;
default:
dev_err(lp87565->dev, "Invalid lp config %d\n",
lp87565->dev_type);
return -EINVAL;
min_idx = LP87565_BUCK_0;
max_idx = LP87565_BUCK_3;
break;
}

for (i = min_idx; i <= max_idx; i++) {
Expand Down

0 comments on commit a853c0a

Please sign in to comment.