linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] gpio: pisosr: Don't use magic numbers
@ 2016-02-15  9:14 Alexander Stein
  2016-02-16 14:55 ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2016-02-15  9:14 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot; +Cc: Alexander Stein, linux-gpio

At first view I thought this function returned an error, but actually
it is the input direction. Use the define for input which makes reading
the code much easier.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
 drivers/gpio/gpio-pisosr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c
index 58ea08d..068de54 100644
--- a/drivers/gpio/gpio-pisosr.c
+++ b/drivers/gpio/gpio-pisosr.c
@@ -13,6 +13,7 @@
  */
 
 #include <linux/delay.h>
+#include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
 #include <linux/gpio/driver.h>
 #include <linux/module.h>
@@ -65,7 +66,7 @@ static int pisosr_gpio_get_direction(struct gpio_chip *chip,
 				     unsigned offset)
 {
 	/* This device always input */
-	return 1;
+	return GPIOF_DIR_IN;
 }
 
 static int pisosr_gpio_direction_input(struct gpio_chip *chip,
-- 
2.4.10


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-16 16:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15  9:14 [PATCH 1/1] gpio: pisosr: Don't use magic numbers Alexander Stein
2016-02-16 14:55 ` Linus Walleij
2016-02-16 15:35   ` Alexander Stein
2016-02-16 16:00     ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).