Skip to contentSkip to conversation

serial: atmel: Use platform_get_irq() to get the interrupt

PATCH In review Rob Herring 3 participants 4 messages Dec 15, 2021 – Jan 4, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: atmel: Use platform_get_irq() to get the interrupt

Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers continuing to use static IRQ resources is blocking removing the static setup from the DT core code.

---
 drivers/tty/serial/atmel_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/atmel_serial.c +1 -1
index 2c99a47a2535..9e57bfe523cf 100644
@@ -2479,7 +2479,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port,
 	port->fifosize		= 1;
 	port->dev		= &pdev->dev;
 	port->mapbase		= mpdev->resource[0].start;
-	port->irq		= mpdev->resource[1].start;
+	port->irq		= platform_get_irq(mpdev, 0);
 	port->rs485_config	= atmel_config_rs485;
 	port->iso7816_config	= atmel_config_iso7816;
 	port->membase		= NULL;
Signature · 1 line
2.32.0
#1 lore raw

Hello Rob,

Quoted 15 lines · Rob Herring

Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers continuing to use static IRQ resources is blocking removing the static setup from the DT core code.

---
 drivers/tty/serial/atmel_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/atmel_serial.c +0 -0
index 2c99a47a2535..9e57bfe523cf 100644

drivers/tty/serial/atmel_serial.c static int atmel_init_port(struct atmel_uart_port *atmel_port, · line 2481

Quoted 3 lines
drivers/tty/serial/atmel_serial.c +0 -0
@@ -2479,7 +2479,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port,
 	port->fifosize		= 1;
 	port->dev		= &pdev->dev;
 	port->mapbase		= mpdev->resource[0].start;

Shouldn't you fix that one at the same time?

Quoted 8 lines
drivers/tty/serial/atmel_serial.c +1 -1
-	port->irq		= mpdev->resource[1].start;
+	port->irq		= platform_get_irq(mpdev, 0);
 	port->rs485_config	= atmel_config_rs485;
 	port->iso7816_config	= atmel_config_iso7816;
 	port->membase		= NULL;
Signature · 1 line
2.32.0
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 14 lines · Alexandre Belloni

Hello Rob,

Quoted 10 lines · Rob Herring

Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers continuing to use static IRQ resources is blocking removing the static setup from the DT core code.

---
 drivers/tty/serial/atmel_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 10 lines

drivers/tty/serial/atmel_serial.c static int atmel_init_port(struct atmel_uart_port *atmel_port, · line 2481

Quoted 8 lines
drivers/tty/serial/atmel_serial.c +0 -0
index 2c99a47a2535..9e57bfe523cf 100644
@@ -2479,7 +2479,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port,
      port->fifosize          = 1;
      port->dev               = &pdev->dev;
      port->mapbase           = mpdev->resource[0].start;

Shouldn't you fix that one at the same time?

Sure, I'll make a 2nd patch as it has little to do with $subject.

Quoted 14 lines
Quoted 9 lines
drivers/tty/serial/atmel_serial.c +1 -2
-     port->irq               = mpdev->resource[1].start;
+     port->irq               = platform_get_irq(mpdev, 0);
      port->rs485_config      = atmel_config_rs485;
      port->iso7816_config    = atmel_config_iso7816;
      port->membase           = NULL;
--

2.32.0

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Acked-by on v1 1/1
#3 lore raw
In reply to Rob Herring

Le 15/12/2021 à 23:48, Rob Herring a écrit :

Quoted 6 lines

Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers continuing to use static IRQ resources is blocking removing the static setup from the DT core code.

Quoted 9 lines
---
  drivers/tty/serial/atmel_serial.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/atmel_serial.c +0 -0
index 2c99a47a2535..9e57bfe523cf 100644

drivers/tty/serial/atmel_serial.c static int atmel_init_port(struct atmel_uart_port *atmel_port, · line 2485

Quoted 8 lines
drivers/tty/serial/atmel_serial.c +1 -1
@@ -2479,7 +2479,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port,
  	port->fifosize		= 1;
  	port->dev		= &pdev->dev;
  	port->mapbase		= mpdev->resource[0].start;
-	port->irq		= mpdev->resource[1].start;
+	port->irq		= platform_get_irq(mpdev, 0);
  	port->rs485_config	= atmel_config_rs485;
  	port->iso7816_config	= atmel_config_iso7816;
  	port->membase		= NULL;

Thanks !

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel