Skip to content

Commit

Permalink
ARM: cleanup: regulator_get() error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King committed Feb 24, 2013
1 parent 8628795 commit f863440
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/arm/mach-tegra/board-harmony-pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ int __init harmony_pcie_init(void)
gpio_direction_output(en_vdd_1v05, 1);

regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk");
if (IS_ERR_OR_NULL(regulator)) {
pr_err("%s: regulator_get failed: %d\n", __func__,
(int)PTR_ERR(regulator));
if (IS_ERR(regulator)) {
err = PTR_ERR(regulator);
pr_err("%s: regulator_get failed: %d\n", __func__, err);
goto err_reg;
}

Expand Down

0 comments on commit f863440

Please sign in to comment.