From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-gpio@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] extcon: int3496: don't use GPIOF_* with gpiod_get_direction
Date: Sun, 14 Jan 2018 22:07:08 +0100 [thread overview]
Message-ID: <20180114210711.13863-2-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20180114210711.13863-1-wsa+renesas@sang-engineering.com>
The documentation was wrong, gpiod_get_direction() returns 0/1 instead
of the GPIOF_* flags. The docs were fixed with commit 94fc73094abe47
("gpio: correct docs about return value of gpiod_get_direction"). Now,
fix this user (until a better, system-wide solution is in place). This
also means we can drop the deprecated use of 'linux/gpio.h'. Yay!
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Only build tested!
drivers/extcon/extcon-intel-int3496.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-intel-int3496.c
index c8691b5a9cb00c..256a25e511671d 100644
--- a/drivers/extcon/extcon-intel-int3496.c
+++ b/drivers/extcon/extcon-intel-int3496.c
@@ -20,7 +20,7 @@
#include <linux/acpi.h>
#include <linux/extcon-provider.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/platform_device.h>
@@ -112,7 +112,7 @@ static int int3496_probe(struct platform_device *pdev)
ret = PTR_ERR(data->gpio_usb_id);
dev_err(dev, "can't request USB ID GPIO: %d\n", ret);
return ret;
- } else if (gpiod_get_direction(data->gpio_usb_id) != GPIOF_DIR_IN) {
+ } else if (gpiod_get_direction(data->gpio_usb_id) != 1) {
dev_warn(dev, FW_BUG "USB ID GPIO not in input mode, fixing\n");
gpiod_direction_input(data->gpio_usb_id);
}
--
2.11.0
next prev parent reply other threads:[~2018-01-14 21:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-14 21:07 [PATCH 0/3] tree-wide: don't use GPIOF_* with gpiod_get_direction Wolfram Sang
2018-01-14 21:07 ` Wolfram Sang [this message]
2018-01-14 21:07 ` [PATCH 2/3] serial: mxs-auart: " Wolfram Sang
2018-01-14 21:07 ` [PATCH 3/3] backlight: pwm_bl: " Wolfram Sang
2018-01-15 10:13 ` Daniel Thompson
2018-04-16 9:11 ` Lee Jones
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=20180114210711.13863-2-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=cw00.choi@samsung.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
/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).