diff --git a/subsys/pm/pm_shell.c b/subsys/pm/pm_shell.c index e228e0b7e3..f656cf4426 100644 --- a/subsys/pm/pm_shell.c +++ b/subsys/pm/pm_shell.c @@ -9,9 +9,14 @@ #include #include +static bool pm_device_filter(const struct device *dev) +{ + return dev->pm != NULL; +} + static void device_name_get(size_t idx, struct shell_static_entry *entry) { - const struct device *dev = shell_device_lookup(idx, NULL); + const struct device *dev = shell_device_filter(idx, pm_device_filter); entry->syntax = (dev != NULL) ? dev->name : NULL; entry->handler = NULL;