drm: Cleanups after drmm_add_final_kfree rollout
[linux-block.git] / include / drm / drm_managed.h
CommitLineData
c6603c74
DV
1// SPDX-License-Identifier: GPL-2.0
2
3#ifndef _DRM_MANAGED_H_
4#define _DRM_MANAGED_H_
5
6#include <linux/gfp.h>
7#include <linux/types.h>
8
9struct drm_device;
10
11typedef void (*drmres_release_t)(struct drm_device *dev, void *res);
12
13#define drmm_add_action(dev, action, data) \
14 __drmm_add_action(dev, action, data, #action)
15
16int __must_check __drmm_add_action(struct drm_device *dev,
17 drmres_release_t action,
18 void *data, const char *name);
19
20void drmm_add_final_kfree(struct drm_device *dev, void *parent);
21
22void *drmm_kmalloc(struct drm_device *dev, size_t size, gfp_t gfp) __malloc;
23static inline void *drmm_kzalloc(struct drm_device *dev, size_t size, gfp_t gfp)
24{
25 return drmm_kmalloc(dev, size, gfp | __GFP_ZERO);
26}
27
28void drmm_kfree(struct drm_device *dev, void *data);
29
30#endif