drivers: serial: stm32: Don't block PM if pinctrl sleep state is absent

When dealing with pm action 'suspend', driver applies device pinctrl sleep
state.
Using PM_DEVICE modes should allow to save more current consumption, and
applying pinctrl sleep state is one of the gains, but sleep state not being
available on a device is not a sufficient reason to block PM transition
to lower power mode.
If this pin state is not provided for the device, warn but don't block
pm transition. This will save some time to users setting up this feature
for the first time. Warning will give the opportunity to users to fine
tune their setup in a later step.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c
index 2e77caa..5de02fb 100644
--- a/drivers/serial/uart_stm32.c
+++ b/drivers/serial/uart_stm32.c
@@ -1740,7 +1740,7 @@
 		break;
 	case PM_DEVICE_ACTION_SUSPEND:
 		uart_stm32_suspend_setup(dev);
-		/* Stop device clock */
+		/* Stop device clock. Note: fixed clocks are not handled yet. */
 		err = clock_control_off(data->clock, (clock_control_subsys_t)&config->pclken[0]);
 		if (err != 0) {
 			LOG_ERR("Could not enable (LP)UART clock");
@@ -1749,7 +1749,10 @@
 
 		/* Move pins to sleep state */
 		err = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP);
-		if (err < 0) {
+		if (err == -ENOENT) {
+			/* Warn but don't block PM suspend */
+			LOG_WRN("(LP)UART pinctrl sleep state not available ");
+		} else if (err < 0) {
 			return err;
 		}
 		break;