]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kunit: provide kunit_platform_device_unregister()
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Fri, 22 May 2026 13:42:17 +0000 (15:42 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Tue, 26 May 2026 09:19:54 +0000 (11:19 +0200)
commit136569e6bc7b2d62e6777ef47caf0a417d70bf4a
tree9795f6bc81bf090db60869d31e186806990e795d
parent4c237ab773c93959aa2a7750f9dba772b5f1baee
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>
include/kunit/platform_device.h
lib/kunit/platform.c