From c22e34397ea648b2e7316ab307e635bf85af7da3 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 30 Sep 2020 07:06:21 -0500 Subject: [PATCH] drivers: serial: stm32: set default parity in driver Have the driver default to UART_CFG_PARITY_NONE if no parity property exists rather than using default in binding. Signed-off-by: Kumar Gala --- drivers/serial/uart_stm32.c | 2 +- dts/bindings/serial/st,stm32-lpuart.yaml | 5 +++-- dts/bindings/serial/st,stm32-uart.yaml | 5 +++-- dts/bindings/serial/st,stm32-usart.yaml | 5 +++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index c5c4d36f65e..e51fe07dd40 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -826,7 +826,7 @@ static const struct uart_stm32_config uart_stm32_cfg_##index = { \ .enr = DT_INST_CLOCKS_CELL(index, bits) \ }, \ .hw_flow_control = DT_INST_PROP(index, hw_flow_control), \ - .parity = DT_INST_PROP(index, parity), \ + .parity = DT_INST_PROP_OR(index, parity, UART_CFG_PARITY_NONE), \ .pinctrl_list = uart_pins_##index, \ .pinctrl_list_size = ARRAY_SIZE(uart_pins_##index), \ }; \ diff --git a/dts/bindings/serial/st,stm32-lpuart.yaml b/dts/bindings/serial/st,stm32-lpuart.yaml index f6856b60c67..cc94b2bf724 100644 --- a/dts/bindings/serial/st,stm32-lpuart.yaml +++ b/dts/bindings/serial/st,stm32-lpuart.yaml @@ -17,8 +17,9 @@ properties: parity: required: false type: int - description: Configures the parity of the adapter. Value 0 for none, 1 for odd and 2 for even parity. - default: 0 + description: | + Configures the parity of the adapter. Value 0 for none, 1 for odd + and 2 for even parity. Default to none if not specified. pinctrl-0: type: phandles diff --git a/dts/bindings/serial/st,stm32-uart.yaml b/dts/bindings/serial/st,stm32-uart.yaml index 3a1856caf68..40398a92cfb 100644 --- a/dts/bindings/serial/st,stm32-uart.yaml +++ b/dts/bindings/serial/st,stm32-uart.yaml @@ -14,8 +14,9 @@ properties: parity: required: false type: int - description: Configures the parity of the adapter. Value 0 for none, 1 for odd and 2 for even parity. - default: 0 + description: | + Configures the parity of the adapter. Value 0 for none, 1 for odd + and 2 for even parity. Default to none if not specified. pinctrl-0: type: phandles diff --git a/dts/bindings/serial/st,stm32-usart.yaml b/dts/bindings/serial/st,stm32-usart.yaml index ce6639ef340..cc5531cde05 100644 --- a/dts/bindings/serial/st,stm32-usart.yaml +++ b/dts/bindings/serial/st,stm32-usart.yaml @@ -14,8 +14,9 @@ properties: parity: required: false type: int - description: Configures the parity of the adapter. Value 0 for none, 1 for odd and 2 for even parity. - default: 0 + description: | + Configures the parity of the adapter. Value 0 for none, 1 for odd + and 2 for even parity. Default to none if not specified. pinctrl-0: type: phandles