[U-Boot] [PATCH] dm: core: Widen the dump tree to show more of the driver's name.

With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com --- drivers/core/dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/core/dump.c b/drivers/core/dump.c index d7cdb1475d..9d59fa90b2 100644 --- a/drivers/core/dump.c +++ b/drivers/core/dump.c @@ -15,8 +15,8 @@ static void show_devices(struct udevice *dev, int depth, int last_flag) int i, is_last; struct udevice *child;
- /* print the first 11 characters to not break the tree-format. */ - printf(" %-10.10s %d [ %c ] %-10.10s ", dev->uclass->uc_drv->name, + /* print the first 20 characters to not break the tree-format. */ + printf(" %-10.10s %d [ %c ] %-20.20s ", dev->uclass->uc_drv->name, dev_get_uclass_index(dev, NULL), dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ', dev->driver->name);
@@ -49,8 +49,8 @@ void dm_dump_all(void)
root = dm_root(); if (root) { - printf(" Class index Probed Driver Name\n"); - printf("-----------------------------------------\n"); + printf(" Class index Probed Driver Name\n"); + printf("-----------------------------------------------------------\n"); show_devices(root, -1, 0); } }

On 17 September 2018 at 10:57, Liviu Dudau Liviu.Dudau@foss.arm.com wrote:
With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com
drivers/core/dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

Hi,
On 17 September 2018 at 20:06, Simon Glass sjg@chromium.org wrote:
On 17 September 2018 at 10:57, Liviu Dudau Liviu.Dudau@foss.arm.com wrote:
With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com
drivers/core/dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
Unfortunately this seems to break some tests (make tests). Please can you take a look?
Regards, Simon

On Fri, Sep 28, 2018 at 04:14:12PM -0600, Simon Glass wrote:
Hi,
Hi Simon,
On 17 September 2018 at 20:06, Simon Glass sjg@chromium.org wrote:
On 17 September 2018 at 10:57, Liviu Dudau Liviu.Dudau@foss.arm.com wrote:
With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com
drivers/core/dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
Unfortunately this seems to break some tests (make tests). Please can you take a look?
I've had a go at trying to run 'make tests' on my machine but things fail miserably for me. Attached is the output of the command. U-Boot is v2018.11-rc1 plus my remaining patches that have not yet been merged.
It looks to me like the 'sandbox' board (or defconfig) needs some updating? Please advise!
Best regards, Liviu
Regards, Simon

Hi Liviu,
On 2 October 2018 at 03:46, Liviu Dudau Liviu.Dudau@foss.arm.com wrote:
On Fri, Sep 28, 2018 at 04:14:12PM -0600, Simon Glass wrote:
Hi,
Hi Simon,
On 17 September 2018 at 20:06, Simon Glass sjg@chromium.org wrote:
On 17 September 2018 at 10:57, Liviu Dudau Liviu.Dudau@foss.arm.com wrote:
With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com
drivers/core/dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
Unfortunately this seems to break some tests (make tests). Please can you take a look?
I've had a go at trying to run 'make tests' on my machine but things fail miserably for me. Attached is the output of the command. U-Boot is v2018.11-rc1 plus my remaining patches that have not yet been merged.
It looks to me like the 'sandbox' board (or defconfig) needs some updating? Please advise!
I cannot explain your build log - it looks completely wrong.
Can you try:
make O=sandbox sandbox_defconfig make O=sandbox
?
Maybe try 'make mrproper' first?
But still, the errors seems to make no sense. E.g. CONFIG_SANDBOX_SPI_MAX_BUS is defined in a config file.
Also what gcc version are you using on your computer?
Regards, Simon

On Tue, Oct 02, 2018 at 04:22:25AM -0700, Simon Glass wrote:
Hi Liviu,
On 2 October 2018 at 03:46, Liviu Dudau Liviu.Dudau@foss.arm.com wrote:
On Fri, Sep 28, 2018 at 04:14:12PM -0600, Simon Glass wrote:
Hi,
Hi Simon,
On 17 September 2018 at 20:06, Simon Glass sjg@chromium.org wrote:
On 17 September 2018 at 10:57, Liviu Dudau Liviu.Dudau@foss.arm.com wrote:
With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com
drivers/core/dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
Unfortunately this seems to break some tests (make tests). Please can you take a look?
I've had a go at trying to run 'make tests' on my machine but things fail miserably for me. Attached is the output of the command. U-Boot is v2018.11-rc1 plus my remaining patches that have not yet been merged.
It looks to me like the 'sandbox' board (or defconfig) needs some updating? Please advise!
I cannot explain your build log - it looks completely wrong.
Can you try:
make O=sandbox sandbox_defconfig make O=sandbox
?
Maybe try 'make mrproper' first?
I've done that before.
But still, the errors seems to make no sense. E.g. CONFIG_SANDBOX_SPI_MAX_BUS is defined in a config file.
I think I have fixed the issue. I believe it was due to some stray include/config.mk file that was a leftover from the times I switched to an old Exynos tree trying to update an SMDK4422 board.
I can now see the relevant errors and I will come up with a patch.
Many thanks, Liviu
Also what gcc version are you using on your computer?
Regards, Simon

Commit ("dm: core: Widen the dump tree to show more of the driver's name") has widened the field reserved for the name of a driver, so we need to update the test to match.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com --- test/py/tests/test_bind.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/test/py/tests/test_bind.py b/test/py/tests/test_bind.py index f21b7059ea..dee3fee566 100644 --- a/test/py/tests/test_bind.py +++ b/test/py/tests/test_bind.py @@ -13,7 +13,7 @@ def in_tree(response, name, uclass, drv, depth, last_child): else: leaf = leaf + '`' leaf = leaf + '-- ' + name - line = ' *{:10.10} [0-9]* [ [ +] ] {:10.10} {}$'.format(uclass, drv,leaf) + line = ' *{:10.10} [0-9]* [ [ +] ] {:20.20} {}$'.format(uclass, drv, leaf) prog = re.compile(line) for l in lines: if prog.match(l): @@ -28,31 +28,31 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#Unbind child #1. No error expected and all devices should be there except for bind-test-child1 response = u_boot_console.run_command("unbind /bind-test/bind-test-child1") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert "bind-test-child1" not in tree - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#bind child #1. No error expected and all devices should be there response = u_boot_console.run_command("bind /bind-test/bind-test-child1 phy_sandbox") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, True) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, False) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, False)
#Unbind child #2. No error expected and all devices should be there except for bind-test-child2 response = u_boot_console.run_command("unbind /bind-test/bind-test-child2") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, True) assert "bind-test-child2" not in tree
@@ -61,9 +61,9 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test/bind-test-child2 generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#Unbind parent. No error expected. All devices should be removed and unbound response = u_boot_console.run_command("unbind /bind-test") @@ -89,9 +89,9 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
response = u_boot_console.run_command("unbind /bind-test") assert response == '' @@ -138,7 +138,7 @@ def test_bind_unbind_with_uclass(u_boot_console): response = u_boot_console.run_command("unbind simple_bus {}".format(child_of_child2_index)) assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True) assert not in_tree(tree, "generic_simple_bus", "simple_bus", "generic_simple_bus", 2, True) child_of_child2_line = get_next_line(tree, "bind-test-child2") assert child_of_child2_line == "" @@ -161,7 +161,7 @@ def test_bind_unbind_with_uclass(u_boot_console): assert response == ''
tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
child_of_child2_line = get_next_line(tree, "bind-test-child2") assert child_of_child2_line == ""

On 2 October 2018 at 09:22, Liviu Dudau Liviu.Dudau@foss.arm.com wrote:
Commit ("dm: core: Widen the dump tree to show more of the driver's name") has widened the field reserved for the name of a driver, so we need to update the test to match.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com
test/py/tests/test_bind.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Tue, Oct 02, 2018 at 04:22:58PM +0100, Liviu Dudau wrote:
Commit ("dm: core: Widen the dump tree to show more of the driver's name") has widened the field reserved for the name of a driver, so we need to update the test to match.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com
test/py/tests/test_bind.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
For me, this breaks "make tests".

Hi Tom,
On 11 October 2018 at 08:11, Tom Rini trini@konsulko.com wrote:
On Tue, Oct 02, 2018 at 04:22:58PM +0100, Liviu Dudau wrote:
Commit ("dm: core: Widen the dump tree to show more of the driver's name") has widened the field reserved for the name of a driver, so we need to update the test to match.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com
test/py/tests/test_bind.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
For me, this breaks "make tests".
Yes, it needs another patch, that I dropped because it breaks the tests. This patch fixes them but only if that patch is applied.
Liviu, how about sending a patch that combines both?
Regards, Simon

With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Also update the tests to take into account the wider output format.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com Reviewed-by: Simon Glass sjg@chromium.org ---
Changelog: - v2: merged the patch introducing the wider output with the patch updating the tests so that they can be applied in one go.
drivers/core/dump.c | 8 ++++---- test/py/tests/test_bind.py | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/core/dump.c b/drivers/core/dump.c index d7cdb1475d..9d59fa90b2 100644 --- a/drivers/core/dump.c +++ b/drivers/core/dump.c @@ -15,8 +15,8 @@ static void show_devices(struct udevice *dev, int depth, int last_flag) int i, is_last; struct udevice *child;
- /* print the first 11 characters to not break the tree-format. */ - printf(" %-10.10s %d [ %c ] %-10.10s ", dev->uclass->uc_drv->name, + /* print the first 20 characters to not break the tree-format. */ + printf(" %-10.10s %d [ %c ] %-20.20s ", dev->uclass->uc_drv->name, dev_get_uclass_index(dev, NULL), dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ', dev->driver->name);
@@ -49,8 +49,8 @@ void dm_dump_all(void)
root = dm_root(); if (root) { - printf(" Class index Probed Driver Name\n"); - printf("-----------------------------------------\n"); + printf(" Class index Probed Driver Name\n"); + printf("-----------------------------------------------------------\n"); show_devices(root, -1, 0); } } diff --git a/test/py/tests/test_bind.py b/test/py/tests/test_bind.py index f21b7059ea..dee3fee566 100644 --- a/test/py/tests/test_bind.py +++ b/test/py/tests/test_bind.py @@ -13,7 +13,7 @@ def in_tree(response, name, uclass, drv, depth, last_child): else: leaf = leaf + '`' leaf = leaf + '-- ' + name - line = ' *{:10.10} [0-9]* [ [ +] ] {:10.10} {}$'.format(uclass, drv,leaf) + line = ' *{:10.10} [0-9]* [ [ +] ] {:20.20} {}$'.format(uclass, drv, leaf) prog = re.compile(line) for l in lines: if prog.match(l): @@ -28,31 +28,31 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#Unbind child #1. No error expected and all devices should be there except for bind-test-child1 response = u_boot_console.run_command("unbind /bind-test/bind-test-child1") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert "bind-test-child1" not in tree - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#bind child #1. No error expected and all devices should be there response = u_boot_console.run_command("bind /bind-test/bind-test-child1 phy_sandbox") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, True) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, False) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, False)
#Unbind child #2. No error expected and all devices should be there except for bind-test-child2 response = u_boot_console.run_command("unbind /bind-test/bind-test-child2") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, True) assert "bind-test-child2" not in tree
@@ -61,9 +61,9 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test/bind-test-child2 generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#Unbind parent. No error expected. All devices should be removed and unbound response = u_boot_console.run_command("unbind /bind-test") @@ -89,9 +89,9 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
response = u_boot_console.run_command("unbind /bind-test") assert response == '' @@ -138,7 +138,7 @@ def test_bind_unbind_with_uclass(u_boot_console): response = u_boot_console.run_command("unbind simple_bus {}".format(child_of_child2_index)) assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True) assert not in_tree(tree, "generic_simple_bus", "simple_bus", "generic_simple_bus", 2, True) child_of_child2_line = get_next_line(tree, "bind-test-child2") assert child_of_child2_line == "" @@ -161,7 +161,7 @@ def test_bind_unbind_with_uclass(u_boot_console): assert response == ''
tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
child_of_child2_line = get_next_line(tree, "bind-test-child2") assert child_of_child2_line == ""

With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Also update the tests to take into account the wider output format.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com Reviewed-by: Simon Glass sjg@chromium.org ---
Changelog: - v2: merged the patch introducing the wider output with the patch updating the tests so that they can be applied in one go.
drivers/core/dump.c | 8 ++++---- test/py/tests/test_bind.py | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-)
Applied to u-boot-dm/master, thanks!

From: Liviu Dudau Liviu.Dudau@foss.arm.com
With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree.
Also update the tests to take into account the wider output format.
Signed-off-by: Liviu Dudau liviu.dudau@foss.arm.com Reviewed-by: Simon Glass sjg@chromium.org --- (Looks like foss.arm.com server is having troubles delivering emails, this patch is stuck for a while in the send queue, so I'm using my private email)
Changelog: - v2: merged the patch introducing the wider output with the patch updating the tests so that they can be applied in one go.
drivers/core/dump.c | 8 ++++---- test/py/tests/test_bind.py | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/core/dump.c b/drivers/core/dump.c index d7cdb1475d..9d59fa90b2 100644 --- a/drivers/core/dump.c +++ b/drivers/core/dump.c @@ -15,8 +15,8 @@ static void show_devices(struct udevice *dev, int depth, int last_flag) int i, is_last; struct udevice *child;
- /* print the first 11 characters to not break the tree-format. */ - printf(" %-10.10s %d [ %c ] %-10.10s ", dev->uclass->uc_drv->name, + /* print the first 20 characters to not break the tree-format. */ + printf(" %-10.10s %d [ %c ] %-20.20s ", dev->uclass->uc_drv->name, dev_get_uclass_index(dev, NULL), dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ', dev->driver->name);
@@ -49,8 +49,8 @@ void dm_dump_all(void)
root = dm_root(); if (root) { - printf(" Class index Probed Driver Name\n"); - printf("-----------------------------------------\n"); + printf(" Class index Probed Driver Name\n"); + printf("-----------------------------------------------------------\n"); show_devices(root, -1, 0); } } diff --git a/test/py/tests/test_bind.py b/test/py/tests/test_bind.py index f21b7059ea..dee3fee566 100644 --- a/test/py/tests/test_bind.py +++ b/test/py/tests/test_bind.py @@ -13,7 +13,7 @@ def in_tree(response, name, uclass, drv, depth, last_child): else: leaf = leaf + '`' leaf = leaf + '-- ' + name - line = ' *{:10.10} [0-9]* [ [ +] ] {:10.10} {}$'.format(uclass, drv,leaf) + line = ' *{:10.10} [0-9]* [ [ +] ] {:20.20} {}$'.format(uclass, drv, leaf) prog = re.compile(line) for l in lines: if prog.match(l): @@ -28,31 +28,31 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#Unbind child #1. No error expected and all devices should be there except for bind-test-child1 response = u_boot_console.run_command("unbind /bind-test/bind-test-child1") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert "bind-test-child1" not in tree - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#bind child #1. No error expected and all devices should be there response = u_boot_console.run_command("bind /bind-test/bind-test-child1 phy_sandbox") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, True) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, False) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, False)
#Unbind child #2. No error expected and all devices should be there except for bind-test-child2 response = u_boot_console.run_command("unbind /bind-test/bind-test-child2") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, True) assert "bind-test-child2" not in tree
@@ -61,9 +61,9 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test/bind-test-child2 generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
#Unbind parent. No error expected. All devices should be removed and unbound response = u_boot_console.run_command("unbind /bind-test") @@ -89,9 +89,9 @@ def test_bind_unbind_with_node(u_boot_console): response = u_boot_console.run_command("bind /bind-test generic_simple_bus") assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test", "simple_bus", "generic_simple", 0, True) + assert in_tree(tree, "bind-test", "simple_bus", "generic_simple_bus", 0, True) assert in_tree(tree, "bind-test-child1", "phy", "phy_sandbox", 1, False) - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
response = u_boot_console.run_command("unbind /bind-test") assert response == '' @@ -138,7 +138,7 @@ def test_bind_unbind_with_uclass(u_boot_console): response = u_boot_console.run_command("unbind simple_bus {}".format(child_of_child2_index)) assert response == '' tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True) assert not in_tree(tree, "generic_simple_bus", "simple_bus", "generic_simple_bus", 2, True) child_of_child2_line = get_next_line(tree, "bind-test-child2") assert child_of_child2_line == "" @@ -161,7 +161,7 @@ def test_bind_unbind_with_uclass(u_boot_console): assert response == ''
tree = u_boot_console.run_command("dm tree") - assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple", 1, True) + assert in_tree(tree, "bind-test-child2", "simple_bus", "generic_simple_bus", 1, True)
child_of_child2_line = get_next_line(tree, "bind-test-child2") assert child_of_child2_line == ""
participants (5)
-
Liviu Dudau
-
Liviu Dudau
-
Simon Glass
-
sjg@google.com
-
Tom Rini