Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: atmel: use macros instead of hardcoded values

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>

authored by

Claudiu Beznea and committed by
Greg Kroah-Hartman
aec079f8 4c9883e1

+2 -2
+2 -2
drivers/tty/serial/atmel_serial.c
··· 2084 2084 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 2085 2085 2086 2086 switch (state) { 2087 - case 0: 2087 + case UART_PM_STATE_ON: 2088 2088 /* 2089 2089 * Enable the peripheral clock for this serial port. 2090 2090 * This is called on uart_open() or a resume event. ··· 2094 2094 /* re-enable interrupts if we disabled some on suspend */ 2095 2095 atmel_uart_writel(port, ATMEL_US_IER, atmel_port->backup_imr); 2096 2096 break; 2097 - case 3: 2097 + case UART_PM_STATE_OFF: 2098 2098 /* Back up the interrupt mask and disable all interrupts */ 2099 2099 atmel_port->backup_imr = atmel_uart_readl(port, ATMEL_US_IMR); 2100 2100 atmel_uart_writel(port, ATMEL_US_IDR, -1);