From: Alexander Stein <alexander.stein@systec-electronic.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>,
linux-gpio@vger.kernel.org
Subject: [PATCH 1/1] gpio: pisosr: Don't use magic numbers
Date: Mon, 15 Feb 2016 10:14:00 +0100 [thread overview]
Message-ID: <1455527640-10446-1-git-send-email-alexander.stein@systec-electronic.com> (raw)
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
next reply other threads:[~2016-02-15 9:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 9:14 Alexander Stein [this message]
2016-02-16 14:55 ` [PATCH 1/1] gpio: pisosr: Don't use magic numbers Linus Walleij
2016-02-16 15:35 ` Alexander Stein
2016-02-16 16:00 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455527640-10446-1-git-send-email-alexander.stein@systec-electronic.com \
--to=alexander.stein@systec-electronic.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).