#phy-cells = <0>;
};
+ phy_provider3: gen_phy@3 {
+ compatible = "sandbox,phy";
+ #phy-cells = <2>;
+ };
+
gen_phy_user: gen_phy_user {
compatible = "simple-bus";
phys = <&phy_provider0 0>, <&phy_provider0 1>, <&phy_provider1>;
phy-names = "phy1", "phy2";
};
+ gen_phy_user2: gen_phy_user2 {
+ compatible = "simple-bus";
+ phys = <&phy_provider3 0 0>;
+ phy-names = "phy1";
+ };
+
some-bus {
#address-cells = <1>;
#size-cells = <0>;
ut_assert(phy2.dev != phy3.dev);
/* Try to get a non-existing phy */
- ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 4, &dev));
+ ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 5, &dev));
ut_asserteq(-ENODATA, generic_phy_get_by_name(parent,
"phy_not_existing", &phy1_method1));
ut_assert(!generic_phy_valid(&phy1_method1));
&phy1_method2));
ut_assert(!generic_phy_valid(&phy1_method2));
+ /* Try to get a phy where of_xlate fail */
+ ut_assertok(uclass_get_device_by_name(UCLASS_SIMPLE_BUS,
+ "gen_phy_user2", &parent));
+ ut_asserteq(-EINVAL, generic_phy_get_by_name(parent, "phy1",
+ &phy1_method1));
+ ut_assert(!generic_phy_valid(&phy1_method1));
+ ut_asserteq(-EINVAL, generic_phy_get_by_index(parent, 0,
+ &phy1_method2));
+ ut_assert(!generic_phy_valid(&phy1_method2));
+
return 0;
}
DM_TEST(dm_test_phy_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);