Thread (1 message) 1 message, 1 author, 2013-07-17

[PATCH v8] reset: Add driver for gpio-controlled reset pins

From: Shawn Guo <hidden>
Date: 2013-07-17 03:43:15
Also in: linux-devicetree

On Tue, Jul 16, 2013 at 09:47:02AM -0600, Stephen Warren wrote:
quoted
diff --git a/drivers/reset/gpio-reset.c b/drivers/reset/gpio-reset.c
quoted
-	gpio_set_value(drvdata->gpio, value);
+	if (gpio_cansleep(drvdata->gpio))
+		gpio_set_value_cansleep(drvdata->gpio, value);
+	else
+		gpio_set_value(drvdata->gpio, value);
That's not right. Calling gpio_set_value() v.s.
gpio_set_value_cansleep() should be based on the properties of the
calling context, not the GPIO being controlled. In other words, if it's
permissible to call gpio_set_value_cansleep() at this point in the code,
simply always call that, and remove the conditional logic.
Ah, yes.  I was confused by the API gpio_cansleep().  Which API we
should call depends on the calling context.  And the context should
come from the gpio-reset client device driver.  IOW, we have no idea
what the context is in gpio-reset driver.  To start with something
simple, we may want to define the gpio-reset as a sleepable interface
and always call gpio_set_value_cansleep() in there.

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