Lines Matching +full:platform +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0
3 * KUnit test for KUnit platform driver infrastructure.
12 * Test that kunit_platform_device_alloc() creates a platform device.
17 kunit_platform_device_alloc(test, "kunit-platform", 1)); in kunit_platform_device_alloc_test()
21 * Test that kunit_platform_device_add() registers a platform device on the
22 * platform bus with the proper name and id.
27 const char *name = "kunit-platform-add"; in kunit_platform_device_add_test() local
28 const int id = -1; in kunit_platform_device_add_test()
30 pdev = kunit_platform_device_alloc(test, name, id); in kunit_platform_device_add_test()
34 KUNIT_EXPECT_TRUE(test, dev_is_platform(&pdev->dev)); in kunit_platform_device_add_test()
35 KUNIT_EXPECT_STREQ(test, pdev->name, name); in kunit_platform_device_add_test()
36 KUNIT_EXPECT_EQ(test, pdev->id, id); in kunit_platform_device_add_test()
40 * Test that kunit_platform_device_add() called twice with the same device name
46 const char *name = "kunit-platform-add-2"; in kunit_platform_device_add_twice_fails_test() local
47 const int id = -1; in kunit_platform_device_add_twice_fails_test()
49 pdev = kunit_platform_device_alloc(test, name, id); in kunit_platform_device_add_twice_fails_test()
53 pdev = kunit_platform_device_alloc(test, name, id); in kunit_platform_device_add_twice_fails_test()
65 * Test that kunit_platform_device_add() cleans up by removing the platform
70 const char *name = "kunit-platform-clean"; in kunit_platform_device_add_cleans_up() local
71 const int id = -1; in kunit_platform_device_add_cleans_up()
78 pdev = kunit_platform_device_alloc(&fake, name, id); in kunit_platform_device_add_cleans_up()
81 dev = bus_find_device(&platform_bus_type, NULL, name, in kunit_platform_device_add_cleans_up()
91 * put_device() call on the platform device. The best we can do here is in kunit_platform_device_add_cleans_up()
98 dev = bus_find_device(&platform_bus_type, NULL, name, in kunit_platform_device_add_cleans_up()
116 .name = "kunit_platform_device",
130 return container_of(to_platform_driver(pdev->dev.driver), in to_test_context()
140 ctx->data = test_data; in kunit_platform_driver_probe()
151 const char *name = "kunit-platform-register"; in kunit_platform_driver_register_test() local
156 pdev = kunit_platform_device_alloc(test, name, -1); in kunit_platform_driver_register_test()
160 ctx->pdrv.probe = kunit_platform_driver_probe; in kunit_platform_driver_register_test()
161 ctx->pdrv.driver.name = name; in kunit_platform_driver_register_test()
162 ctx->pdrv.driver.owner = THIS_MODULE; in kunit_platform_driver_register_test()
166 KUNIT_EXPECT_EQ(test, 0, kunit_platform_driver_register(test, &ctx->pdrv)); in kunit_platform_driver_register_test()
168 KUNIT_EXPECT_STREQ(test, ctx->data, test_data); in kunit_platform_driver_register_test()
180 const char *name = "kunit-platform-wait"; in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed() local
185 pdev = kunit_platform_device_alloc(test, name, -1); in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed()
189 ctx->pdrv.probe = kunit_platform_driver_probe; in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed()
190 ctx->pdrv.driver.name = name; in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed()
191 ctx->pdrv.driver.owner = THIS_MODULE; in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed()
195 KUNIT_ASSERT_EQ(test, 0, kunit_platform_driver_register(test, &ctx->pdrv)); in kunit_platform_device_prepare_wait_for_probe_completes_when_already_probed()
214 .name = "kunit_platform_driver",
224 MODULE_DESCRIPTION("KUnit test for KUnit platform driver infrastructure");