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

serial: stm32: change register's offset type from u8 to u16

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>

authored by

Valentin Caron and committed by
Greg Kroah-Hartman
7be985bd 7316888f

+13 -13
+13 -13
drivers/tty/serial/stm32-usart.h
··· 9 9 #define DRIVER_NAME "stm32-usart" 10 10 11 11 struct stm32_usart_offsets { 12 - u8 cr1; 13 - u8 cr2; 14 - u8 cr3; 15 - u8 brr; 16 - u8 gtpr; 17 - u8 rtor; 18 - u8 rqr; 19 - u8 isr; 20 - u8 icr; 21 - u8 rdr; 22 - u8 tdr; 23 - u8 presc; 12 + u16 cr1; 13 + u16 cr2; 14 + u16 cr3; 15 + u16 brr; 16 + u16 gtpr; 17 + u16 rtor; 18 + u16 rqr; 19 + u16 isr; 20 + u16 icr; 21 + u16 rdr; 22 + u16 tdr; 23 + u16 presc; 24 24 }; 25 25 26 26 struct stm32_usart_config { ··· 37 37 struct stm32_usart_config cfg; 38 38 }; 39 39 40 - #define UNDEF_REG 0xff 40 + #define UNDEF_REG 0xffff 41 41 42 42 /* USART_SR (F4) / USART_ISR (F7) */ 43 43 #define USART_SR_PE BIT(0)