Skip to content
Snippets Groups Projects
Commit a535a371 authored by Simon Glass's avatar Simon Glass
Browse files

dm: core: Adjust dump-sorting to get stats only when needed


If we are not sorting the tree we don't need to get the stats. Adjust the
code to avoid the wasted time.

Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
parent 65b9b346
No related branches found
No related tags found
No related merge requests found
......@@ -90,9 +90,8 @@ static void dm_dump_tree_single(struct udevice *dev, bool sort)
int dev_count, uclasses;
struct udevice **devs = NULL;
dm_get_stats(&dev_count, &uclasses);
if (sort) {
dm_get_stats(&dev_count, &uclasses);
devs = calloc(dev_count, sizeof(struct udevice *));
if (!devs) {
printf("(out of memory)\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment