Skip to content

Commit c957387

Browse files
Peng Wubroonie
authored andcommitted
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: 27b9ecc ("regulator: Add of_regulator_bulk_get_all") Signed-off-by: Peng Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 9211402 commit c957387

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/regulator/of_regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ int of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
767767
memcpy(name, prop->name, i);
768768
name[i] = '\0';
769769
tmp = regulator_get(dev, name);
770-
if (!tmp) {
770+
if (IS_ERR(tmp)) {
771771
ret = -EINVAL;
772772
goto error;
773773
}

0 commit comments

Comments
 (0)