diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-05-22 16:42:17 +0300 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-05-26 12:19:54 +0300 |
| commit | 136569e6bc7b2d62e6777ef47caf0a417d70bf4a (patch) | |
| tree | 9795f6bc81bf090db60869d31e186806990e795d /include | |
| parent | 4c237ab773c93959aa2a7750f9dba772b5f1baee (diff) | |
| download | linux-136569e6bc7b2d62e6777ef47caf0a417d70bf4a.tar.xz | |
kunit: provide kunit_platform_device_unregister()
Tests may want to unregister a platform device as part of the test case
logic. Using the regular platform_device_register() with kunit
assertions may result in a platform device leak or otherwise requires
cumbersome error handling. Provide a function that unregisters a
kunit-managed platform device and drops the release action from the
test's list.
Reviewed-by: David Gow <david@davidgow.net>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260522-gpiolib-kunit-v3-2-b15fe6987430@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/kunit/platform_device.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/kunit/platform_device.h b/include/kunit/platform_device.h index 8cad6e1c3e7e..eee565d5d1d3 100644 --- a/include/kunit/platform_device.h +++ b/include/kunit/platform_device.h @@ -14,6 +14,8 @@ int kunit_platform_device_add(struct kunit *test, struct platform_device *pdev); struct platform_device * kunit_platform_device_register_full(struct kunit *test, const struct platform_device_info *pdevinfo); +void kunit_platform_device_unregister(struct kunit *test, + struct platform_device *pdev); int kunit_platform_device_prepare_wait_for_probe(struct kunit *test, struct platform_device *pdev, |
