[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211221071634.25980-2-yu.tu@amlogic.com>
Date: Tue, 21 Dec 2021 15:16:32 +0800
From: Yu Tu <yu.tu@...ogic.com>
To: <linux-serial@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-amlogic@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Neil Armstrong <narmstrong@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Yu Tu <yu.tu@...ogic.com>
Subject: [PATCH 1/3] tty: serial: meson: modify request_irq and free_irq
Change request_irq to devm_request_irq and free_irq to devm_free_irq.
It's better to change the code this way.
The IRQF_SHARED interrupt flag was added because an interrupt error was
detected when the serial port was opened twice in a row on the project.
Signed-off-by: Yu Tu <yu.tu@...ogic.com>
---
drivers/tty/serial/meson_uart.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index d2c08b760f83..02fafb8229d2 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -121,7 +121,7 @@ static void meson_uart_shutdown(struct uart_port *port)
unsigned long flags;
u32 val;
- free_irq(port->irq, port);
+ devm_free_irq(port->dev, port->irq, port);
spin_lock_irqsave(&port->lock, flags);
@@ -287,8 +287,8 @@ static int meson_uart_startup(struct uart_port *port)
val = (AML_UART_RECV_IRQ(1) | AML_UART_XMIT_IRQ(port->fifosize / 2));
writel(val, port->membase + AML_UART_MISC);
- ret = request_irq(port->irq, meson_uart_interrupt, 0,
- port->name, port);
+ ret = devm_request_irq(port->dev, port->irq, meson_uart_interrupt,
+ IRQF_SHARED, port->name, port);
return ret;
}
--
2.33.1
Powered by blists - more mailing lists