serial: mxs-auart: replace hardcoded 1 with predefined macro GPIO_LINE_DIRECTION_IN
Subsystems (2)
PATCH v2 1/1 serial: mxs-auart: replace hardcoded 1 with predefined macro GPIO_LINE_DIRECTION_IN
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 <[email protected]>
---
Changes since v1:
- Commit title change
https://lore.kernel.org/all/[email protected]/
drivers/tty/serial/mxs-auart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/mxs-auart.c +1 -1
@@ -1520,7 +1520,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 ;
Signature · 1 line
2.53.0