diff --git a/drivers/regulator/regulator_shell.c b/drivers/regulator/regulator_shell.c index 7524e71c946..259b4f8e89c 100644 --- a/drivers/regulator/regulator_shell.c +++ b/drivers/regulator/regulator_shell.c @@ -522,9 +522,14 @@ static int cmd_shipmode(const struct shell *sh, size_t argc, char **argv) return 0; } +static bool device_is_regulator(const struct device *dev) +{ + return DEVICE_API_IS(regulator, dev); +} + 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, device_is_regulator); entry->syntax = (dev != NULL) ? dev->name : NULL; entry->handler = NULL;