From 63638ceed6f6fef1743d4ad2171ed67cef96c275 Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Mon, 30 Nov 2020 12:18:44 -0600 Subject: [PATCH] shell: use public API to check device readiness Avoid the private API now that there's a public equivalent. Signed-off-by: Peter Bigot --- subsys/shell/modules/device_service.c | 4 ++-- subsys/shell/shell_utils.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/shell/modules/device_service.c b/subsys/shell/modules/device_service.c index 270f91be931..21169c1141a 100644 --- a/subsys/shell/modules/device_service.c +++ b/subsys/shell/modules/device_service.c @@ -39,7 +39,7 @@ static bool device_get_config_level(const struct shell *shell, int level) bool devices = false; for (dev = levels[level]; dev < levels[level+1]; dev++) { - if (z_device_ready(dev)) { + if (device_is_ready(dev)) { devices = true; shell_fprintf(shell, SHELL_NORMAL, "- %s\n", dev->name); @@ -92,7 +92,7 @@ static int cmd_device_list(const struct shell *shell, shell_fprintf(shell, SHELL_NORMAL, "devices:\n"); for (dev = __device_start; dev != __device_end; dev++) { - if (!z_device_ready(dev)) { + if (!device_is_ready(dev)) { continue; } diff --git a/subsys/shell/shell_utils.c b/subsys/shell/shell_utils.c index 844c0fc6db0..aea755bd30d 100644 --- a/subsys/shell/shell_utils.c +++ b/subsys/shell/shell_utils.c @@ -469,7 +469,7 @@ const struct device *shell_device_lookup(size_t idx, const struct device *dev_end = dev + len; while (dev < dev_end) { - if (z_device_ready(dev) + if (device_is_ready(dev) && (dev->name != NULL) && (strlen(dev->name) != 0) && ((prefix == NULL)