Skip to content

Commit f863440

Browse files
author
Russell King
committed
ARM: cleanup: regulator_get() error handling
regulator_get() does not return NULL as an error value. Even when it does return an error, the code as written falls out the error path while returning zero (indicating no failure.) Fix this, and use the more correct IS_ERR() macro to check for errors. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 8628795 commit f863440

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm/mach-tegra/board-harmony-pcie.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ int __init harmony_pcie_init(void)
5656
gpio_direction_output(en_vdd_1v05, 1);
5757

5858
regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk");
59-
if (IS_ERR_OR_NULL(regulator)) {
60-
pr_err("%s: regulator_get failed: %d\n", __func__,
61-
(int)PTR_ERR(regulator));
59+
if (IS_ERR(regulator)) {
60+
err = PTR_ERR(regulator);
61+
pr_err("%s: regulator_get failed: %d\n", __func__, err);
6262
goto err_reg;
6363
}
6464

0 commit comments

Comments
 (0)