Skip to content

Commit 2eddf50

Browse files
committed
modules: power: Do not fail on -EALREADY
The PM actions should not cause a failure if they return -EALREADY. That only indicates that the desired state is already set. Signed-off-by: Jan Tore Guggedal <jantore.guggedal@nordicsemi.no>
1 parent ad950d6 commit 2eddf50

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

app/src/modules/power/power.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ static int uart_disable(void)
195195
k_busy_wait(100 * USEC_PER_MSEC);
196196

197197
err = pm_device_action_run(uart1_dev, PM_DEVICE_ACTION_SUSPEND);
198-
if (err) {
198+
if (err && (err != -EALREADY)) {
199199
LOG_ERR("pm_device_action_run, error: %d", err);
200200
return err;
201201
}
202202

203203
err = pm_device_action_run(uart0_dev, PM_DEVICE_ACTION_SUSPEND);
204-
if (err) {
205-
LOG_ERR("pm_device_actiöon_run, error: %d", err);
204+
if (err && (err != -EALREADY)) {
205+
LOG_ERR("pm_device_action_run, error: %d", err);
206206
return err;
207207
}
208208

@@ -220,13 +220,13 @@ static int uart_enable(void)
220220
}
221221

222222
err = pm_device_action_run(uart0_dev, PM_DEVICE_ACTION_RESUME);
223-
if (err) {
223+
if (err && (err != -EALREADY)) {
224224
LOG_ERR("pm_device_action_run, error: %d", err);
225225
return err;
226226
}
227227

228228
err = pm_device_action_run(uart1_dev, PM_DEVICE_ACTION_RESUME);
229-
if (err) {
229+
if (err && (err != -EALREADY)) {
230230
LOG_ERR("pm_device_action_run, error: %d", err);
231231
return err;
232232
}

0 commit comments

Comments
 (0)