tty: serial: atmel: use macros instead of hardcoded values
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Thu, 7 Oct 2021 11:20:14 +0000 (14:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Oct 2021 13:20:09 +0000 (15:20 +0200)
Use UART_PM_STATE_ON, UART_PM_STATE_OFF instead of hardcoded values.

Reviewed-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Acked-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20211007112014.2332019-1-claudiu.beznea@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/atmel_serial.c

index 249ea35..2c99a47 100644 (file)
@@ -2084,7 +2084,7 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state,
        struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
 
        switch (state) {
-       case 0:
+       case UART_PM_STATE_ON:
                /*
                 * Enable the peripheral clock for this serial port.
                 * This is called on uart_open() or a resume event.
@@ -2094,7 +2094,7 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state,
                /* re-enable interrupts if we disabled some on suspend */
                atmel_uart_writel(port, ATMEL_US_IER, atmel_port->backup_imr);
                break;
-       case 3:
+       case UART_PM_STATE_OFF:
                /* Back up the interrupt mask and disable all interrupts */
                atmel_port->backup_imr = atmel_uart_readl(port, ATMEL_US_IMR);
                atmel_uart_writel(port, ATMEL_US_IDR, -1);