aboutsummaryrefslogtreecommitdiff
path: root/bsd-core/drm_fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-core/drm_fops.c')
-rw-r--r--bsd-core/drm_fops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bsd-core/drm_fops.c b/bsd-core/drm_fops.c
index 6850f489..e4cf8461 100644
--- a/bsd-core/drm_fops.c
+++ b/bsd-core/drm_fops.c
@@ -41,7 +41,7 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
struct drm_device *dev)
{
struct drm_file *priv;
- int m = minor(kdev);
+ int m = dev2unit(kdev);
int retcode;
if (flags & O_EXCL)
@@ -50,14 +50,14 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
DRM_DEBUG("pid = %d, minor = %d\n", DRM_CURRENTPID, m);
- priv = malloc(sizeof(*priv), M_DRM, M_NOWAIT | M_ZERO);
+ priv = malloc(sizeof(*priv), DRM_MEM_FILES, M_NOWAIT | M_ZERO);
if (priv == NULL) {
return ENOMEM;
}
retcode = devfs_set_cdevpriv(priv, drm_close);
if (retcode != 0) {
- free(priv, M_DRM);
+ free(priv, DRM_MEM_FILES);
return retcode;
}
@@ -76,7 +76,7 @@ int drm_open_helper(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
retcode = -dev->driver->open(dev, priv);
if (retcode != 0) {
devfs_clear_cdevpriv();
- free(priv, M_DRM);
+ free(priv, DRM_MEM_FILES);
DRM_UNLOCK();
return retcode;
}