Lines Matching refs:kunit_resource
20 struct kunit_resource;
22 typedef int (*kunit_resource_init_t)(struct kunit_resource *, void *);
23 typedef void (*kunit_resource_free_t)(struct kunit_resource *);
26 * struct kunit_resource - represents a *test managed resource*
50 * static int kunit_kmalloc_init(struct kunit_resource *res, void *context)
61 * static void kunit_kmalloc_free(struct kunit_resource *res)
82 struct kunit_resource {
324 * Like kunit_alloc_resource() below, but returns the struct kunit_resource
327 struct kunit_resource *kunit_alloc_and_get_resource(struct kunit *test,
339 static inline void kunit_get_resource(struct kunit_resource *res)
350 struct kunit_resource *res = container_of(kref, struct kunit_resource,
372 static inline void kunit_put_resource(struct kunit_resource *res)
390 struct kunit_resource *res,
405 struct kunit_resource *res,
418 * cleaned up at the end of a test case. See &struct kunit_resource for an
421 * Note: KUnit needs to allocate memory for a kunit_resource object. You must
431 struct kunit_resource *res;
444 struct kunit_resource *res,
457 struct kunit_resource *res,
470 struct kunit_resource *res,
482 static inline struct kunit_resource *
487 struct kunit_resource *res, *found = NULL;
509 static inline struct kunit_resource *
518 * kunit_destroy_resource() - Find a kunit_resource and destroy it.
524 * 0 if kunit_resource is found and freed, -ENOENT if not found.
547 void kunit_remove_resource(struct kunit *test, struct kunit_resource *res);
557 * kunit_resource for more information.