serial: stm32: change register's offset type from u8 to u16
authorValentin Caron <valentin.caron@foss.st.com>
Fri, 12 Jan 2024 09:52:59 +0000 (10:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 03:04:11 +0000 (19:04 -0800)
USART has registers above 0xff offset, so extend variable type to u16.
And change UNDEF_REG to 0xffff.

Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Link: https://lore.kernel.org/r/20240112095300.2004878-4-valentin.caron@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/stm32-usart.h

index 5ce1d3aae07e7a9fda0e33a7a7d6328fe3b211f2..bf3720948704efbcf18d9e6c585854fc7d8983f3 100644 (file)
@@ -9,18 +9,18 @@
 #define DRIVER_NAME "stm32-usart"
 
 struct stm32_usart_offsets {
-       u8 cr1;
-       u8 cr2;
-       u8 cr3;
-       u8 brr;
-       u8 gtpr;
-       u8 rtor;
-       u8 rqr;
-       u8 isr;
-       u8 icr;
-       u8 rdr;
-       u8 tdr;
-       u8 presc;
+       u16 cr1;
+       u16 cr2;
+       u16 cr3;
+       u16 brr;
+       u16 gtpr;
+       u16 rtor;
+       u16 rqr;
+       u16 isr;
+       u16 icr;
+       u16 rdr;
+       u16 tdr;
+       u16 presc;
 };
 
 struct stm32_usart_config {
@@ -37,7 +37,7 @@ struct stm32_usart_info {
        struct stm32_usart_config cfg;
 };
 
-#define UNDEF_REG 0xff
+#define UNDEF_REG 0xffff
 
 /* USART_SR (F4) / USART_ISR (F7) */
 #define USART_SR_PE            BIT(0)