diff mbox series

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

Message ID 20211215224832.1985402-1-robh@kernel.org
State New
Headers show
Series serial: atmel: Use platform_get_irq() to get the interrupt | expand

Commit Message

Rob Herring (Arm) Dec. 15, 2021, 10:48 p.m. UTC
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.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/tty/serial/atmel_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexandre Belloni Dec. 15, 2021, 11:37 p.m. UTC | #1
Hello Rob,

On 15/12/2021 16:48:31-0600, Rob Herring wrote:
> 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.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/tty/serial/atmel_serial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 2c99a47a2535..9e57bfe523cf 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -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?

> -	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
>
Rob Herring (Arm) Dec. 16, 2021, 9:22 p.m. UTC | #2
On Wed, Dec 15, 2021 at 5:37 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> Hello Rob,
>
> On 15/12/2021 16:48:31-0600, Rob Herring wrote:
> > 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.
> >
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  drivers/tty/serial/atmel_serial.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> > index 2c99a47a2535..9e57bfe523cf 100644
> > --- a/drivers/tty/serial/atmel_serial.c
> > +++ b/drivers/tty/serial/atmel_serial.c
> > @@ -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.

>
> > -     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
Richard Genoud Jan. 4, 2022, 2:57 p.m. UTC | #3
Le 15/12/2021 à 23:48, Rob Herring a écrit :
> 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.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Richard Genoud <richard.genoud@gmail.com>

> ---
>   drivers/tty/serial/atmel_serial.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 2c99a47a2535..9e57bfe523cf 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -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 !
diff mbox series

Patch

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 2c99a47a2535..9e57bfe523cf 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -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;