Skip to content

Commit a853c0a

Browse files
AxelLinbroonie
authored andcommitted
regulator: lp87565: Fix probe failure for "ti,lp87565"
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 27988c9 commit a853c0a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/regulator/lp87565-regulator.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int lp87565_regulator_probe(struct platform_device *pdev)
163163
struct lp87565 *lp87565 = dev_get_drvdata(pdev->dev.parent);
164164
struct regulator_config config = { };
165165
struct regulator_dev *rdev;
166-
int i, min_idx = LP87565_BUCK_0, max_idx = LP87565_BUCK_3;
166+
int i, min_idx, max_idx;
167167

168168
platform_set_drvdata(pdev, lp87565);
169169

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

190190
for (i = min_idx; i <= max_idx; i++) {

0 commit comments

Comments
 (0)