serial: core: Do not hold the port lock when setting the term GPIO
requested to merge github/fork/linosanfilippo-kunbus/fix/REVPI-3278/fix_RS485_warning into devel/revpi-6.1
Created by: linosanfilippo-kunbus
Both callers of uart_rs485_config() call the function with the port lock held. uart_rs485_config() however may sleep so in both cases the call results in a warning splat.
Fix this by moving the sleepable part (i.e. the call to uart_set_rs485_termination()) out of uart_rs485_config() into the callers and only call uart_set_rs485_termination() if the RS 485 configuration was successful.
This has also the advantage that the termination GPIO is not set if setting the RS 485 configuration has failed.
Fixes: 7c7f9bc9 ("serial: Deassert Transmit Enable on probe in driver-specific way")