xref: /linux/drivers/gpu/drm/nouveau/include/nvif/parent.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVIF_PARENT_H__
3 #define __NVIF_PARENT_H__
4 #include <nvif/os.h>
5 struct nvif_object;
6 
7 struct nvif_parent {
8 	const struct nvif_parent_func {
9 		void (*debugf)(struct nvif_object *, const char *fmt, ...) __printf(2, 3);
10 		void (*errorf)(struct nvif_object *, const char *fmt, ...) __printf(2, 3);
11 	} *func;
12 };
13 
14 static inline void
nvif_parent_dtor(struct nvif_parent * parent)15 nvif_parent_dtor(struct nvif_parent *parent)
16 {
17 	parent->func = NULL;
18 }
19 
20 static inline void
nvif_parent_ctor(const struct nvif_parent_func * func,struct nvif_parent * parent)21 nvif_parent_ctor(const struct nvif_parent_func *func, struct nvif_parent *parent)
22 {
23 	parent->func = func;
24 }
25 #endif
26