Commit d0566564 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: max597x: Fix error return code in max597x_get_status

REGULATOR_FAILED_RETRY should not be used in max597x_get_status error path.
Othewise, the regulator core will treat it as REGULATOR_STATUS_ON.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20230220105614.356187-1-axel.lin@ingics.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7f62cb88
......@@ -193,7 +193,7 @@ static int max597x_get_status(struct regulator_dev *rdev)
ret = regmap_read(rdev->regmap, MAX5970_REG_STATUS3, &val);
if (ret)
return REGULATOR_FAILED_RETRY;
return ret;
if (val & MAX5970_STATUS3_ALERT)
return REGULATOR_STATUS_ERROR;
......
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