diff mbox series

[v5,3/5] sandbox: dts: Add compatible string for bind-test node

Message ID 20200728071335.5840-4-patrice.chotard@st.com
State Accepted
Commit 1f0d5885dbbd669400e5d8cfdb3998c7945e0a7a
Delegated to: Simon Glass
Headers show
Series cmd: bind allow to bind driver with driver_data | expand

Commit Message

Patrice CHOTARD July 28, 2020, 7:13 a.m. UTC
Usage of lists_bind_fdt() in bind command imposes to add
a compatible string for bind-test node.

Others impacts are:
  - bind-test node is binded at sandbox start, so no need to bind it
    in test_bind_unbind_with_node() test.
  - As explained just above, after sandbox start, now a phy exist.
    In test/dm/phy.c, it was verified that a third phy didn't exist,
    now we must verified that a fourth phy doesn't exist.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>

---

Changes in v5:
  - rebase on last master
  - fix phy test regression

 arch/sandbox/dts/test.dts  | 1 +
 test/dm/phy.c              | 2 +-
 test/py/tests/test_bind.py | 3 ---
 3 files changed, 2 insertions(+), 4 deletions(-)

Comments

Simon Glass Aug. 4, 2020, 2 a.m. UTC | #1
On Tue, 28 Jul 2020 at 01:13, Patrice Chotard <patrice.chotard@st.com> wrote:
>
> Usage of lists_bind_fdt() in bind command imposes to add
> a compatible string for bind-test node.
>
> Others impacts are:
>   - bind-test node is binded at sandbox start, so no need to bind it
>     in test_bind_unbind_with_node() test.
>   - As explained just above, after sandbox start, now a phy exist.
>     In test/dm/phy.c, it was verified that a third phy didn't exist,
>     now we must verified that a fourth phy doesn't exist.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>
> ---
>
> Changes in v5:
>   - rebase on last master
>   - fix phy test regression
>
>  arch/sandbox/dts/test.dts  | 1 +
>  test/dm/phy.c              | 2 +-
>  test/py/tests/test_bind.py | 3 ---
>  3 files changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass Aug. 22, 2020, 11:18 p.m. UTC | #2
On Tue, 28 Jul 2020 at 01:13, Patrice Chotard <patrice.chotard@st.com> wrote:
>
> Usage of lists_bind_fdt() in bind command imposes to add
> a compatible string for bind-test node.
>
> Others impacts are:
>   - bind-test node is binded at sandbox start, so no need to bind it
>     in test_bind_unbind_with_node() test.
>   - As explained just above, after sandbox start, now a phy exist.
>     In test/dm/phy.c, it was verified that a third phy didn't exist,
>     now we must verified that a fourth phy doesn't exist.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
>
> ---
>
> Changes in v5:
>   - rebase on last master
>   - fix phy test regression
>
>  arch/sandbox/dts/test.dts  | 1 +
>  test/dm/phy.c              | 2 +-
>  test/py/tests/test_bind.py | 3 ---
>  3 files changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 2ae4239721..75c31f83f4 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -135,6 +135,7 @@ 
 	};
 
 	bind-test {
+		compatible = "simple-bus";
 		bind-test-child1 {
 			compatible = "sandbox,phy";
 			#phy-cells = <1>;
diff --git a/test/dm/phy.c b/test/dm/phy.c
index 99f0119557..cf4c641b63 100644
--- a/test/dm/phy.c
+++ b/test/dm/phy.c
@@ -46,7 +46,7 @@  static int dm_test_phy_base(struct unit_test_state *uts)
 	ut_assert(phy2.dev != phy3.dev);
 
 	/* Try to get a non-existing phy */
-	ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 3, &dev));
+	ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 4, &dev));
 	ut_asserteq(-ENODATA, generic_phy_get_by_name(parent,
 					"phy_not_existing", &phy1_method1));
 
diff --git a/test/py/tests/test_bind.py b/test/py/tests/test_bind.py
index e9681c69c5..1de125ce45 100644
--- a/test/py/tests/test_bind.py
+++ b/test/py/tests/test_bind.py
@@ -25,9 +25,6 @@  def in_tree(response, name, uclass, drv, depth, last_child):
 @pytest.mark.buildconfigspec('cmd_bind')
 def test_bind_unbind_with_node(u_boot_console):
 
-	#bind /bind-test. Device should come up as well as its children
-	response = u_boot_console.run_command('bind  /bind-test simple_bus')
-	assert response == ''
 	tree = u_boot_console.run_command('dm tree')
 	assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
 	assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False)