summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-01-13 15:59:33 +0300
committerMark Brown <broonie@kernel.org>2020-01-13 15:02:48 +0000
commit7eec67869893bc34bd3a3126e5124a4ef017e0cd (patch)
treef39cdefe8c1935e40f383d384f7c54589e7490ed /drivers/regulator
parent686f63616f4aede1356c1bc9fa4e9a92a123bcd6 (diff)
downloadlinux-7eec67869893bc34bd3a3126e5124a4ef017e0cd.tar.gz
linux-7eec67869893bc34bd3a3126e5124a4ef017e0cd.tar.bz2
linux-7eec67869893bc34bd3a3126e5124a4ef017e0cd.zip
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: 6501c1f54a17 ("regulator: mpq7920: add mpq7920 regulator driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20200113125805.xri6jqoxy2ldzqyg@kili.mountain Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/mpq7920.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/mpq7920.c b/drivers/regulator/mpq7920.c
index ab1b847c57e5..80f3131f0d1b 100644
--- a/drivers/regulator/mpq7920.c
+++ b/drivers/regulator/mpq7920.c
@@ -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;