From f863440d54fccbcd0ef0f6d96d81521e0fa41e35 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 24 Feb 2013 10:48:46 +0000 Subject: 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 --- arch/arm/mach-tegra/board-harmony-pcie.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-tegra') diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c index 3cdc1bb8254c..6d29e6a39540 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; } -- cgit v1.2.3 From 23cbd4e84f98b36c91d19990760207112f142c5b Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 24 Feb 2013 10:51:00 +0000 Subject: ARM: cleanup: clk_get_sys() error handling Fix clk_get_sys() error handling; IS_ERR() should be used rather than IS_ERR_OR_NULL() to check for errors. Signed-off-by: Russell King --- arch/arm/mach-tegra/tegra2_emc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-tegra') diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c index e18aa2f83ebf..03e742f0a8cc 100644 --- a/arch/arm/mach-tegra/tegra2_emc.c +++ b/arch/arm/mach-tegra/tegra2_emc.c @@ -276,7 +276,7 @@ static struct tegra_emc_pdata *tegra_emc_fill_pdata(struct platform_device *pdev int i; WARN_ON(pdev->dev.platform_data); - BUG_ON(IS_ERR_OR_NULL(c)); + BUG_ON(IS_ERR(c)); pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); pdata->tables = devm_kzalloc(&pdev->dev, sizeof(*pdata->tables), -- cgit v1.2.3