Skip to contentSkip to conversation

altera_uart: Use dev_err() to report error attaching IRQ handler

PATCH In review Tobias Klauser 2 participants 2 messages Oct 29, 2024 – Oct 30, 2024

Subsystems (2)
lore
Share & tools
lore

Tobias Klauser

author maintainer
#0 lore raw

PATCH 1/1 altera_uart: Use dev_err() to report error attaching IRQ handler

In case of multiple Altera UART ports available on the system, the error message will contain information about the port for which attaching the IRQ handler failed.

---
 drivers/tty/serial/altera_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/altera_uart.c +1 -1
index 8eed2542627e..1da9cd465426 100644
@@ -307,7 +307,7 @@ static int altera_uart_startup(struct uart_port *port)
 		ret = request_irq(port->irq, altera_uart_interrupt, 0,
 				dev_name(port->dev), port);
 		if (ret) {
-			pr_err(DRV_NAME ": unable to attach Altera UART %d "
+			dev_err(port->dev, "unable to attach Altera UART %d "
 			       "interrupt vector=%d\n", port->line, port->irq);
 			return ret;
 		}
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Tobias Klauser

In case of multiple Altera UART ports available on the system, the error message will contain information about the port for which attaching the IRQ handler failed.

And port->dev is properly set in altera_uart_probe().

Quoted 10 lines
---
  drivers/tty/serial/altera_uart.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/altera_uart.c +0 -0
index 8eed2542627e..1da9cd465426 100644

drivers/tty/serial/altera_uart.c static int altera_uart_startup(struct uart_port *port) · line 311

Quoted 6 lines
drivers/tty/serial/altera_uart.c +1 -1
@@ -307,7 +307,7 @@ static int altera_uart_startup(struct uart_port *port)
  		ret = request_irq(port->irq, altera_uart_interrupt, 0,
  				dev_name(port->dev), port);
  		if (ret) {
-			pr_err(DRV_NAME ": unable to attach Altera UART %d "
+			dev_err(port->dev, "unable to attach Altera UART %d "
  			       "interrupt vector=%d\n", port->line, port->irq);

The string should be on a single line. But that's a different story/patch.

thanks,

Signature · 2 lines
js
suse labs