1 // SPDX-License-Identifier: GPL-2.0+
7 #include <virtio_types.h>
9 #include <dm/device-internal.h>
12 #include <dm/uclass-internal.h>
13 #include <test/test.h>
16 /* Test of the virtio driver that does not have required driver ops */
17 static int dm_test_virtio_missing_ops(struct unit_test_state *uts)
21 /* find the virtio device */
22 ut_assertok(uclass_find_device(UCLASS_VIRTIO, 1, &bus));
25 * Probe the device should fail with error -ENOENT.
26 * See ops check in virtio_uclass_pre_probe().
28 ut_asserteq(-ENOENT, device_probe(bus));
32 DM_TEST(dm_test_virtio_missing_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);