mux-control-names = "mux0";
};
+ multimatch-test {
+ compatible = "sandbox,multimatch-test";
+ };
+
phy_provider0: gen_phy@0 {
compatible = "sandbox,phy";
#phy-cells = <1>;
return 0;
}
DM_TEST(dm_test_try_first_device, 0);
+
+/* Test that all drivers are iterated when bind returns -ENODEV */
+static int dm_test_multimatch(struct unit_test_state *uts)
+{
+ struct udevice *dev;
+
+ ut_assertok(uclass_find_device_by_name(UCLASS_TEST, "multimatch-test",
+ &dev));
+ ut_assertnonnull(dev);
+ ut_asserteq_str("test_multimatch_second", dev->driver->name);
+ ut_asserteq(2, dm_testdrv_op_count[DM_TEST_OP_BIND]);
+
+ return 0;
+}
+DM_TEST(dm_test_multimatch, UTF_SCAN_FDT);
.unbind = test_manual_unbind,
.flags = DM_FLAG_VITAL | DM_FLAG_ACTIVE_DMA,
};
+
+static int test_multimatch_first_bind(struct udevice *dev)
+{
+ dm_testdrv_op_count[DM_TEST_OP_BIND]++;
+
+ return -ENODEV;
+}
+
+static const struct udevice_id test_multimatch_ids[] = {
+ { .compatible = "sandbox,multimatch-test" },
+ { }
+};
+
+U_BOOT_DRIVER(test_multimatch_first) = {
+ .name = "test_multimatch_first",
+ .id = UCLASS_TEST,
+ .of_match = test_multimatch_ids,
+ .bind = test_multimatch_first_bind,
+};
+
+U_BOOT_DRIVER(test_multimatch_second) = {
+ .name = "test_multimatch_second",
+ .id = UCLASS_TEST,
+ .of_match = test_multimatch_ids,
+ .bind = test_manual_bind,
+};