shell: use public API to check device readiness

Avoid the private API now that there's a public equivalent.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-11-30 12:18:44 -06:00 committed by Anas Nashif
commit 63638ceed6
2 changed files with 3 additions and 3 deletions

View file

@ -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;
}

View file

@ -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)