dm: core: Show device sequence instead in dm_dump_tree()
Currently uclass index is shown in DM tree dump which ignores alias sequence numbering. The result could be confusing since these 2 numbers could be different. Show device sequence number instead as it's more meaningful. Also update documentation to use sequence number. Signed-off-by: Zixun LI <admin@hifiphile.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -112,9 +112,8 @@ This shows the full tree of devices including the following fields:
|
|||||||
uclass
|
uclass
|
||||||
Shows the name of the uclass for the device
|
Shows the name of the uclass for the device
|
||||||
|
|
||||||
Index
|
Seq
|
||||||
Shows the index number of the device, within the uclass. This shows the
|
Shows the sequence number of the device, within the uclass.
|
||||||
ordering within the uclass, but not the sequence number.
|
|
||||||
|
|
||||||
Probed
|
Probed
|
||||||
Shows `+` if the device is active
|
Shows `+` if the device is active
|
||||||
@@ -366,7 +365,7 @@ dm tree
|
|||||||
This example shows the abridged sandbox output::
|
This example shows the abridged sandbox output::
|
||||||
|
|
||||||
=> dm tree
|
=> dm tree
|
||||||
Class Index Probed Driver Name
|
Class Seq Probed Driver Name
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
root 0 [ + ] root_driver root_driver
|
root 0 [ + ] root_driver root_driver
|
||||||
demo 0 [ ] demo_shape_drv |-- demo_shape_drv
|
demo 0 [ ] demo_shape_drv |-- demo_shape_drv
|
||||||
|
@@ -40,7 +40,7 @@ static void show_devices(struct udevice *dev, int depth, int last_flag,
|
|||||||
/* print the first 20 characters to not break the tree-format. */
|
/* print the first 20 characters to not break the tree-format. */
|
||||||
printf(CONFIG_IS_ENABLED(USE_TINY_PRINTF) ? " %s %d [ %c ] %s " :
|
printf(CONFIG_IS_ENABLED(USE_TINY_PRINTF) ? " %s %d [ %c ] %s " :
|
||||||
" %-10.10s %3d [ %c ] %-20.20s ", dev->uclass->uc_drv->name,
|
" %-10.10s %3d [ %c ] %-20.20s ", dev->uclass->uc_drv->name,
|
||||||
dev_get_uclass_index(dev, NULL),
|
dev->seq_,
|
||||||
flags & DM_FLAG_ACTIVATED ? '+' : ' ', dev->driver->name);
|
flags & DM_FLAG_ACTIVATED ? '+' : ' ', dev->driver->name);
|
||||||
|
|
||||||
for (i = depth; i >= 0; i--) {
|
for (i = depth; i >= 0; i--) {
|
||||||
@@ -129,7 +129,7 @@ void dm_dump_tree(char *dev_name, bool extended, bool sort)
|
|||||||
{
|
{
|
||||||
struct udevice *root;
|
struct udevice *root;
|
||||||
|
|
||||||
printf(" Class Index Probed Driver Name\n");
|
printf(" Class Seq Probed Driver Name\n");
|
||||||
printf("-----------------------------------------------------------\n");
|
printf("-----------------------------------------------------------\n");
|
||||||
|
|
||||||
root = dm_root();
|
root = dm_root();
|
||||||
|
Reference in New Issue
Block a user