mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 21:02:43 +01:00
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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
28 lines
870 B
C
28 lines
870 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _KUNIT_PLATFORM_DRIVER_H
|
|
#define _KUNIT_PLATFORM_DRIVER_H
|
|
|
|
struct completion;
|
|
struct kunit;
|
|
struct platform_device;
|
|
struct platform_driver;
|
|
struct platform_device_info;
|
|
|
|
struct platform_device *
|
|
kunit_platform_device_alloc(struct kunit *test, const char *name, int id);
|
|
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,
|
|
struct completion *x);
|
|
|
|
int kunit_platform_driver_register(struct kunit *test,
|
|
struct platform_driver *drv);
|
|
|
|
#endif
|