Commit 7eec6786 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

regulator: mpq7920: Check the correct variable in mpq7920_regulator_register()

There is a typo in the error checking.  We should be checking
"->rdev[i]" instead of just "->rdev".

Fixes: 6501c1f5 ("regulator: mpq7920: add mpq7920 regulator driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200113125805.xri6jqoxy2ldzqyg@kili.mountainSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 686f6361
......@@ -274,8 +274,8 @@ static inline int mpq7920_regulator_register(
info->rdev[i] = devm_regulator_register(info->dev, rdesc,
config);
if (IS_ERR(info->rdev))
return PTR_ERR(info->rdev);
if (IS_ERR(info->rdev[i]))
return PTR_ERR(info->rdev[i]);
}
return 0;
......
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