console: uart: remove pm_device_runtime_is_enabled check

`pm_device_runtime_get` and `pm_device_runtime_put` have returned `0`
when device runtime PM is not enabled since #56222. Manually checking
the state is no longer required.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
Jordan Yates 2023-11-28 14:14:01 +10:00 committed by Anas Nashif
parent eb2e5de01c
commit d131981257

View file

@ -87,13 +87,11 @@ static int console_out(int c)
#endif /* CONFIG_UART_CONSOLE_DEBUG_SERVER_HOOKS */
if (pm_device_runtime_is_enabled(uart_console_dev)) {
if (pm_device_runtime_get(uart_console_dev) < 0) {
/* Enabling the UART instance has failed but this
* function MUST return the byte output.
*/
return c;
}
if (pm_device_runtime_get(uart_console_dev) < 0) {
/* Enabling the UART instance has failed but this
* function MUST return the byte output.
*/
return c;
}
if ('\n' == c) {
@ -101,10 +99,8 @@ static int console_out(int c)
}
uart_poll_out(uart_console_dev, c);
if (pm_device_runtime_is_enabled(uart_console_dev)) {
/* As errors cannot be returned, ignore the return value */
(void)pm_device_runtime_put(uart_console_dev);
}
/* As errors cannot be returned, ignore the return value */
(void)pm_device_runtime_put(uart_console_dev);
return c;
}