diff mbox

[PATCHv4,3/4] OMAP3: Devkit8000: Check return value of gpio_request

Message ID 1295425166-25540-4-git-send-email-weber@corscience.de (mailing list archive)
State Superseded, archived
Delegated to: Tony Lindgren
Headers show

Commit Message

Thomas Weber Jan. 19, 2011, 8:19 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 9fb416b..4ddd81c 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -234,6 +234,8 @@  static struct gpio_led gpio_leds[];
 static int devkit8000_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
+	int ret;
+
 	omap_mux_init_gpio(29, OMAP_PIN_INPUT);
 	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
 	mmc[0].gpio_cd = gpio + 0;
@@ -244,13 +246,23 @@  static int devkit8000_twl_gpio_setup(struct device *dev,
 
 	/* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
 	devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
-	gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
+	ret = gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
+	if (ret < 0) {
+		printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
+		return ret;
+	}
+
 	/* Disable until needed */
 	gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
 
 	/* gpio + 7 is "DVI_PD" (out, active low) */
 	devkit8000_dvi_device.reset_gpio = gpio + 7;
-	gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
+	ret = gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
+	if (ret < 0) {
+		printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
+		return ret;
+	}
+
 	/* Disable until needed */
 	gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0);