summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorMichal Suchanek <[email protected]>2022-10-12 21:58:08 +0200
committerSimon Glass <[email protected]>2022-10-29 07:36:33 -0600
commit4954937d922840c212b7eba297cc2d4779f087ad (patch)
tree7176fea63bf97553b10dbc57b225886476f81309 /cmd
parentaa5511e77b8bd8f943c66b6403896d06083b1d92 (diff)
dm: treewide: Do not use the return value of simple uclass iterator
uclass_first_device/uclass_next_device return value will be removed, don't use it. With the current implementation dev is equivalent to !ret. It is redundant to check both, ret check can be replaced with dev check, and ret check inside the iteration is dead code. Signed-off-by: Michal Suchanek <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/virtio.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/cmd/virtio.c b/cmd/virtio.c
index ec87d4f02c9..019e317e755 100644
--- a/cmd/virtio.c
+++ b/cmd/virtio.c
@@ -23,18 +23,15 @@ static int do_virtio(struct cmd_tbl *cmdtp, int flag, int argc,
* device_probe() for children (i.e. virtio devices)
*/
struct udevice *bus, *child;
- int ret;
- ret = uclass_first_device(UCLASS_VIRTIO, &bus);
- if (ret)
+ uclass_first_device(UCLASS_VIRTIO, &bus);
+ if (!bus)
return CMD_RET_FAILURE;
while (bus) {
device_foreach_child_probe(child, bus)
;
- ret = uclass_next_device(&bus);
- if (ret)
- break;
+ uclass_next_device(&bus);
}
return CMD_RET_SUCCESS;