* [PATCH 0/3] tree-wide: don't use GPIOF_* with gpiod_get_direction
@ 2018-01-14 21:07 Wolfram Sang
2018-01-14 21:07 ` [PATCH 2/3] serial: mxs-auart: " Wolfram Sang
0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2018-01-14 21:07 UTC (permalink / raw)
To: linux-gpio
Cc: linux-renesas-soc, Wolfram Sang, dri-devel, linux-fbdev,
linux-kernel, linux-pwm, linux-serial
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 the users who got it
as wrong as I did when developing bus recovery for the R-Car I2C driver.
We get rid of two users of 'linux/gpio.h' this way :)
Only build tested due to no hardware.
Wolfram Sang (3):
extcon: int3496: don't use GPIOF_* with gpiod_get_direction
serial: mxs-auart: don't use GPIOF_* with gpiod_get_direction
backlight: pwm_bl: don't use GPIOF_* with gpiod_get_direction
drivers/extcon/extcon-intel-int3496.c | 4 ++--
drivers/tty/serial/mxs-auart.c | 3 +--
drivers/video/backlight/pwm_bl.c | 6 +++---
3 files changed, 6 insertions(+), 7 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/3] serial: mxs-auart: don't use GPIOF_* with gpiod_get_direction
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
0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2018-01-14 21:07 UTC (permalink / raw)
To: linux-gpio
Cc: linux-renesas-soc, Wolfram Sang, Greg Kroah-Hartman, Jiri Slaby,
linux-serial, linux-kernel
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/tty/serial/mxs-auart.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 5b470406bf9d67..079dc47aa142d8 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -40,7 +40,6 @@
#include <asm/cacheflush.h>
-#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/err.h>
#include <linux/irq.h>
@@ -1597,7 +1596,7 @@ static int mxs_auart_init_gpios(struct mxs_auart_port *s, struct device *dev)
for (i = 0; i < UART_GPIO_MAX; i++) {
gpiod = mctrl_gpio_to_gpiod(s->gpios, i);
- if (gpiod && (gpiod_get_direction(gpiod) == GPIOF_DIR_IN))
+ if (gpiod && (gpiod_get_direction(gpiod) == 1))
s->gpio_irq[i] = gpiod_to_irq(gpiod);
else
s->gpio_irq[i] = -EINVAL;
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-14 21:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/3] serial: mxs-auart: " Wolfram Sang
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).