Skip to content

Commit 11dc0bd

Browse files
yongxu-wang15kartben
authored andcommitted
pm: device_system_managed: add warning log for resume failures
Add error logging in pm_resume_devices() to report when a device fails to resume. This improves debuggability by making resume failures visible in the system log. Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
1 parent 7049333 commit 11dc0bd

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

subsys/pm/device_system_managed.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ bool pm_suspend_devices(void)
6868
void pm_resume_devices(void)
6969
{
7070
for (int i = (num_susp - 1); i >= 0; i--) {
71-
pm_device_action_run(TYPE_SECTION_START(pm_device_slots)[i],
72-
PM_DEVICE_ACTION_RESUME);
71+
const struct device *dev = TYPE_SECTION_START(pm_device_slots)[i];
72+
int ret;
73+
74+
ret = pm_device_action_run(dev, PM_DEVICE_ACTION_RESUME);
75+
if (ret < 0) {
76+
LOG_WRN("Failed to resume device %s (%d)", dev->name, ret);
77+
}
7378
}
7479

7580
num_susp = 0;

0 commit comments

Comments
 (0)