Commit c957387c authored by Peng Wu's avatar Peng Wu Committed by Mark Brown

regulator: of: fix a NULL vs IS_ERR() check in of_regulator_bulk_get_all()

The regulator_get() function never returns NULL. It returns error pointers.

Fixes: 27b9ecc7 ("regulator: Add of_regulator_bulk_get_all")
Signed-off-by: default avatarPeng Wu <wupeng58@huawei.com>
Link: https://lore.kernel.org/r/20221122082242.82937-1-wupeng58@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9211402f
......@@ -767,7 +767,7 @@ int of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
memcpy(name, prop->name, i);
name[i] = '\0';
tmp = regulator_get(dev, name);
if (!tmp) {
if (IS_ERR(tmp)) {
ret = -EINVAL;
goto 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