public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] serial: 8250_port: Drop duplicate NULL check
@ 2026-01-28 14:27 Andy Shevchenko
  2026-01-28 15:09 ` Ilpo Järvinen
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-01-28 14:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby (SUSE), linux-kernel, linux-serial
  Cc: Ilpo Järvinen, Andy Shevchenko

serial8250_release_dma() is NULL-aware, no need to check this in the caller.
While at it, make sure DMA won't be used again, by NULLifying the pointer.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_port.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 21fdf84f118f..c40d750d5a4b 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -2366,8 +2366,8 @@ void serial8250_do_shutdown(struct uart_port *port)
 
 	synchronize_irq(port->irq);
 
-	if (up->dma)
-		serial8250_release_dma(up);
+	serial8250_release_dma(up);
+	up->dma = NULL;
 
 	scoped_guard(uart_port_lock_irqsave, port) {
 		if (port->flags & UPF_FOURPORT) {
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH v1 1/1] serial: 8250_port: Drop duplicate NULL check
@ 2026-03-02 15:27 Andy Shevchenko
  2026-03-03  5:25 ` Jiri Slaby
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-03-02 15:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby (SUSE), linux-kernel, linux-serial
  Cc: Andy Shevchenko

serial8250_release_dma() is NULL-aware, no need to check this in the caller.
While at it, make sure DMA won't be used again, by NULLifying the pointer.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_port.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index d99c5ad7e47c..2a830969d22b 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -2366,8 +2366,8 @@ void serial8250_do_shutdown(struct uart_port *port)
 
 	synchronize_irq(port->irq);
 
-	if (up->dma)
-		serial8250_release_dma(up);
+	serial8250_release_dma(up);
+	up->dma = NULL;
 
 	scoped_guard(uart_port_lock_irqsave, port) {
 		if (port->flags & UPF_FOURPORT) {
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-03  8:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28 14:27 [PATCH v1 1/1] serial: 8250_port: Drop duplicate NULL check Andy Shevchenko
2026-01-28 15:09 ` Ilpo Järvinen
2026-01-28 15:44   ` Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2026-03-02 15:27 Andy Shevchenko
2026-03-03  5:25 ` Jiri Slaby
2026-03-03  7:55   ` Andy Shevchenko
2026-03-03  8:26     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox