diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-02-24 10:48:46 +0000 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-02-24 10:48:46 +0000 |
| commit | f863440d54fccbcd0ef0f6d96d81521e0fa41e35 (patch) | |
| tree | 530a76a043da86ba9c3f0d1f219634c0dec5a4e0 | |
| parent | 86287958bdc49e17dfe3dc8a5dd6234235d9c945 (diff) | |
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>
| -rw-r--r-- | arch/arm/mach-tegra/board-harmony-pcie.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c index 3cdc1bb8254..6d29e6a3954 100644 --- a/arch/arm/mach-tegra/board-harmony-pcie.c +++ b/arch/arm/mach-tegra/board-harmony-pcie.c @@ -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; } |
