This command currently activates devices as it lists them. This is not
desirable since it changes the system state. Fix it and avoid printing
a newline if there are no devices in a uclass.
Signed-off-by: Simon Glass <sjg@chromium.org>
continue;
printf("uclass %d: %s\n", id, uc->uc_drv->name);
- for (ret = uclass_first_device(id, &dev);
- dev;
- ret = uclass_next_device(&dev)) {
+ if (list_empty(&uc->dev_head))
+ continue;
+ list_for_each_entry(dev, &uc->dev_head, uclass_node) {
dm_display_line(dev, "");
}
puts("\n");