debug("%s(dev=%p, name=%s, phy=%p)\n", __func__, dev, phy_name, phy);
+ assert(phy);
+ phy->dev = NULL;
+
index = dev_read_stringlist_search(dev, "phy-names", phy_name);
if (index < 0) {
debug("dev_read_stringlist_search() failed: %d\n", index);
* Get the same phy port in 2 different ways and compare.
*/
ut_assertok(generic_phy_get_by_name(parent, "phy1", &phy1_method1));
+ ut_assert(generic_phy_valid(&phy1_method1));
ut_assertok(generic_phy_get_by_index(parent, 0, &phy1_method2));
+ ut_assert(generic_phy_valid(&phy1_method2));
ut_asserteq(phy1_method1.id, phy1_method2.id);
/*
ut_asserteq(-ENODEV, uclass_get_device(UCLASS_PHY, 4, &dev));
ut_asserteq(-ENODATA, generic_phy_get_by_name(parent,
"phy_not_existing", &phy1_method1));
+ ut_assert(!generic_phy_valid(&phy1_method1));
+ ut_asserteq(-ENOENT, generic_phy_get_by_index(parent, 3,
+ &phy1_method2));
+ ut_assert(!generic_phy_valid(&phy1_method2));
return 0;
}