ARM: tegra: Check regulator_enable return values
Dan Willemsen [Thu, 22 Aug 2013 21:07:24 +0000 (14:07 -0700)]
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>

arch/arm/mach-tegra/board-dalmore-panel.c
arch/arm/mach-tegra/board-macallan-panel.c
arch/arm/mach-tegra/board-pluto.c
arch/arm/mach-tegra/board-roth-panel.c

index 471814e..55feea5 100644 (file)
@@ -209,18 +209,21 @@ static int dalmore_hdmi_postsuspend(void)
 
 static int dalmore_hdmi_hotplug_init(struct device *dev)
 {
+       int e = 0;
+
        if (!dalmore_hdmi_vddio) {
                dalmore_hdmi_vddio = regulator_get(dev, "vdd_hdmi_5v0");
                if (WARN_ON(IS_ERR(dalmore_hdmi_vddio))) {
-                       pr_err("%s: couldn't get regulator vdd_hdmi_5v0: %ld\n",
-                               __func__, PTR_ERR(dalmore_hdmi_vddio));
-                               dalmore_hdmi_vddio = NULL;
+                       e = PTR_ERR(dalmore_hdmi_vddio);
+                       pr_err("%s: couldn't get regulator vdd_hdmi_5v0: %d\n",
+                               __func__, e);
+                       dalmore_hdmi_vddio = NULL;
                } else {
-                       regulator_enable(dalmore_hdmi_vddio);
+                       e = regulator_enable(dalmore_hdmi_vddio);
                }
        }
 
-       return 0;
+       return e;
 }
 
 /* Electrical characteristics for HDMI, all modes must be declared here */
index 5981c12..9a85620 100644 (file)
@@ -208,19 +208,22 @@ static int macallan_hdmi_postsuspend(void)
 
 static int macallan_hdmi_hotplug_init(struct device *dev)
 {
+       int e = 0;
+
        if (!macallan_hdmi_vddio) {
                macallan_hdmi_vddio = regulator_get(dev, "vdd_hdmi_5v0");
                if (WARN_ON(IS_ERR(macallan_hdmi_vddio))) {
-                       pr_err("%s: couldn't get regulator vdd_hdmi_5v0: %ld\n",
-                               __func__, PTR_ERR(macallan_hdmi_vddio));
-                               macallan_hdmi_vddio = NULL;
+                       e = PTR_ERR(macallan_hdmi_vddio);
+                       pr_err("%s: couldn't get regulator vdd_hdmi_5v0: %d\n",
+                               __func__, e);
+                       macallan_hdmi_vddio = NULL;
                } else {
-                       regulator_enable(macallan_hdmi_vddio);
+                       e = regulator_enable(macallan_hdmi_vddio);
                        mdelay(5);
                }
        }
 
-       return 0;
+       return e;
 }
 
 static struct tegra_dc_out macallan_disp2_out = {
index 29e5e26..54ccf4b 100644 (file)
@@ -876,10 +876,12 @@ static int baseband_init(void)
        }
 
        baseband_reg = regulator_get(NULL, "vdd_core_bb");
-       if (IS_ERR_OR_NULL(baseband_reg))
+       if (IS_ERR(baseband_reg))
                pr_warn("%s: baseband regulator get failed\n", __func__);
-       else
-               regulator_enable(baseband_reg);
+       else {
+               if (regulator_enable(baseband_reg) != 0)
+                       pr_warn("baseband regulator enable failed\n");
+       }
 
        /* enable pull-up for MDM1 UART RX */
        tegra_pinmux_set_pullupdown(TEGRA_PINGROUP_GPIO_PU1,
index 134dad5..ac67ca1 100644 (file)
@@ -714,16 +714,19 @@ static int roth_hdmi_postsuspend(void)
 
 static int roth_hdmi_hotplug_init(struct device *dev)
 {
+       int e = 0;
+
        if (!roth_hdmi_vddio) {
                roth_hdmi_vddio = regulator_get(dev, "vdd_hdmi_5v0");
                if (WARN_ON(IS_ERR(roth_hdmi_vddio))) {
-                       pr_err("%s: couldn't get regulator vdd_hdmi_5v0: %ld\n",
-                                       __func__, PTR_ERR(roth_hdmi_vddio));
+                       e = PTR_ERR(roth_hdmi_vddio);
+                       pr_err("%s: couldn't get regulator vdd_hdmi_5v0: %d\n",
+                                       __func__, e);
                        roth_hdmi_vddio = NULL;
                } else
-                       regulator_enable(roth_hdmi_vddio);
+                       e = regulator_enable(roth_hdmi_vddio);
        }
-       return 0;
+       return e;
 }
 
 static void roth_hdmi_hotplug_report(bool state)