Thread (12 messages) flat view 12 messages, 5 authors, 2012-05-03
STALE5208d

[PATCH] gpio: Add simple poweroff-gpio driver

From: andrew@lunn.ch (Andrew Lunn)
Date: 2012-05-03 08:50:26

+	if (gpio_request(gpio_num, "poweroff-gpio")) {
+		pr_err("%s: Could not get GPIO %d", __func__, gpio_num);
+		return -ENODEV;
+	}
+	if (gpio_direction_output(gpio_num, gpio_active_low)) {
+		pr_err("%s: Could not set direction of GPIO %d",
+		       __func__, gpio_num);
+		return -ENODEV;
+	}
On error, you are missing a gpio_free().

   Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help