Commit f863440d authored by Russell King's avatar Russell King

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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 86287958
...@@ -56,9 +56,9 @@ int __init harmony_pcie_init(void) ...@@ -56,9 +56,9 @@ int __init harmony_pcie_init(void)
gpio_direction_output(en_vdd_1v05, 1); gpio_direction_output(en_vdd_1v05, 1);
regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk"); regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk");
if (IS_ERR_OR_NULL(regulator)) { if (IS_ERR(regulator)) {
pr_err("%s: regulator_get failed: %d\n", __func__, err = PTR_ERR(regulator);
(int)PTR_ERR(regulator)); pr_err("%s: regulator_get failed: %d\n", __func__, err);
goto err_reg; goto err_reg;
} }
......
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