arm: tegra: pluto: fix coverity issue
Sri Krishna chowdary [Tue, 16 Oct 2012 12:54:57 +0000 (17:54 +0530)]
Check return value.

Bug 1046331

Change-Id: I313d5868e1a47110f30345d6b19b188fd025c09c
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/144893
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ashwini Ghuge <aghuge@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

Rebase-Id: R958aed2798fe67e72c02cd680f87aba343809ca4

arch/arm/mach-tegra/board-pluto-pinmux.c

index 6b2bc4e..b613ee8 100644 (file)
@@ -587,8 +587,17 @@ static __initdata struct tegra_pingroup_config unused_pins_lowpower[] = {
 
 static void __init pluto_pinmux_audio_init(void)
 {
-       gpio_request(TEGRA_GPIO_CDC_IRQ, "rt5640");
-       gpio_direction_input(TEGRA_GPIO_CDC_IRQ);
+       int ret = gpio_request(TEGRA_GPIO_CDC_IRQ, "rt5640");
+       if (ret < 0) {
+               pr_err("%s: gpio_request failed %d\n", __func__, ret);
+               return;
+       }
+       ret = gpio_direction_input(TEGRA_GPIO_CDC_IRQ);
+       if (ret < 0) {
+               pr_err("%s: gpio_direction_input failed %d\n",
+                       __func__, ret);
+               gpio_free(TEGRA_GPIO_CDC_IRQ);
+       }
 
 }