* [PATCH] serial: mxs-auart: Compare the return value of gpiod_get_direction against GPIO_LINE_DIRECTION_IN
@ 2026-04-16 8:32 Nikola Z. Ivanov
2026-04-17 8:22 ` Frank Li
0 siblings, 1 reply; 3+ messages in thread
From: Nikola Z. Ivanov @ 2026-04-16 8:32 UTC (permalink / raw)
To: gregkh, jirislaby, Frank.Li, s.hauer, kernel, festevam
Cc: linux-kernel, linux-serial, imx, linux-arm-kernel,
Nikola Z. Ivanov
The GPIO_LINE_DIRECTION_* definitions have just recently been exposed to
gpio consumers.h by breaking them out in a separate defs.h file.
Use this to validate the gpio direction instead of the hard-coded literal.
Signed-off-by: Nikola Z. Ivanov <zlatistiv@gmail.com>
---
drivers/tty/serial/mxs-auart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index cc65c9fb6446..6c6df4d5c21f 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -1519,7 +1519,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) == 1))
+ if (gpiod && (gpiod_get_direction(gpiod) == GPIO_LINE_DIRECTION_IN))
s->gpio_irq[i] = gpiod_to_irq(gpiod);
else
s->gpio_irq[i] = -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] serial: mxs-auart: Compare the return value of gpiod_get_direction against GPIO_LINE_DIRECTION_IN
2026-04-16 8:32 [PATCH] serial: mxs-auart: Compare the return value of gpiod_get_direction against GPIO_LINE_DIRECTION_IN Nikola Z. Ivanov
@ 2026-04-17 8:22 ` Frank Li
2026-04-17 10:31 ` Nikola Z. Ivanov
0 siblings, 1 reply; 3+ messages in thread
From: Frank Li @ 2026-04-17 8:22 UTC (permalink / raw)
To: Nikola Z. Ivanov
Cc: gregkh, jirislaby, s.hauer, kernel, festevam, linux-kernel,
linux-serial, imx, linux-arm-kernel
On Thu, Apr 16, 2026 at 11:32:54AM +0300, Nikola Z. Ivanov wrote:
subjust suggest change to
Replace hardcode 1 with predefined macro GPIO_LINE_DIRECTION_IN
Frank
> The GPIO_LINE_DIRECTION_* definitions have just recently been exposed to
> gpio consumers.h by breaking them out in a separate defs.h file.
>
> Use this to validate the gpio direction instead of the hard-coded literal.
>
> Signed-off-by: Nikola Z. Ivanov <zlatistiv@gmail.com>
> ---
> drivers/tty/serial/mxs-auart.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
> index cc65c9fb6446..6c6df4d5c21f 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -1519,7 +1519,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) == 1))
> + if (gpiod && (gpiod_get_direction(gpiod) == GPIO_LINE_DIRECTION_IN))
> s->gpio_irq[i] = gpiod_to_irq(gpiod);
> else
> s->gpio_irq[i] = -EINVAL;
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] serial: mxs-auart: Compare the return value of gpiod_get_direction against GPIO_LINE_DIRECTION_IN
2026-04-17 8:22 ` Frank Li
@ 2026-04-17 10:31 ` Nikola Z. Ivanov
0 siblings, 0 replies; 3+ messages in thread
From: Nikola Z. Ivanov @ 2026-04-17 10:31 UTC (permalink / raw)
To: Frank Li
Cc: gregkh, jirislaby, s.hauer, kernel, festevam, linux-kernel,
linux-serial, imx, linux-arm-kernel
On 4/17/26 11:22 AM, Frank Li wrote:
> On Thu, Apr 16, 2026 at 11:32:54AM +0300, Nikola Z. Ivanov wrote:
>
> subjust suggest change to
>
> Replace hardcode 1 with predefined macro GPIO_LINE_DIRECTION_IN
>
> Frank
Hello,
I suppose you are suggesting a subject change, in that case I will send v2.
Also I can see that automated code review notes that this will not build
on greg's tty tree as 7.0 is not yet merged into it. I will wait for
that to happen
before mailing v2.
BR,
Nikola
>
>> The GPIO_LINE_DIRECTION_* definitions have just recently been exposed to
>> gpio consumers.h by breaking them out in a separate defs.h file.
>>
>> Use this to validate the gpio direction instead of the hard-coded literal.
>>
>> Signed-off-by: Nikola Z. Ivanov <zlatistiv@gmail.com>
>> ---
>> drivers/tty/serial/mxs-auart.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
>> index cc65c9fb6446..6c6df4d5c21f 100644
>> --- a/drivers/tty/serial/mxs-auart.c
>> +++ b/drivers/tty/serial/mxs-auart.c
>> @@ -1519,7 +1519,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) == 1))
>> + if (gpiod && (gpiod_get_direction(gpiod) == GPIO_LINE_DIRECTION_IN))
>> s->gpio_irq[i] = gpiod_to_irq(gpiod);
>> else
>> s->gpio_irq[i] = -EINVAL;
>> --
>> 2.53.0
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-17 10:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 8:32 [PATCH] serial: mxs-auart: Compare the return value of gpiod_get_direction against GPIO_LINE_DIRECTION_IN Nikola Z. Ivanov
2026-04-17 8:22 ` Frank Li
2026-04-17 10:31 ` Nikola Z. Ivanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox