From: Nikola Z. Ivanov Date: Sun, 26 Apr 2026 21:42:50 +0000 (+0300) Subject: serial: mxs-auart: replace hardcoded 1 with predefined macro GPIO_LINE_DIRECTION_IN X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=455d4ed5ea5dbdd690f96b5e0582d760cbfc9e8d;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patch.msgid.link/20260426214250.781151-1-zlatistiv@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 693b491f1e75..697318dbb146 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -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;