xref: /linux/drivers/gpu/drm/nouveau/include/nvif/parent.h (revision 26fbb4c8c7c3ee9a4c3b4de555a8587b5a19154e)
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
15 nvif_parent_dtor(struct nvif_parent *parent)
16 {
17 	parent->func = NULL;
18 }
19 
20 static inline void
21 nvif_parent_ctor(const struct nvif_parent_func *func, struct nvif_parent *parent)
22 {
23 	parent->func = func;
24 }
25 #endif
26