summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/drm_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index f5c99f4e41c..820a133c6a2 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -42,6 +42,7 @@
#include <sys/param.h>
#include <sys/limits.h>
+#include <sys/specdev.h>
#include <sys/systm.h>
#include <uvm/uvm.h>
#include <uvm/uvm_device.h>
@@ -333,7 +334,7 @@ drm_find_file_by_minor(struct drm_device *dev, int minor)
struct drm_device *
drm_get_device_from_kdev(dev_t kdev)
{
- int unit = minor(kdev) & 0xff;
+ int unit = minor(kdev) & ((1 << CLONE_SHIFT) - 1);
if (unit < drm_cd.cd_ndevs)
return drm_cd.cd_devs[unit];