]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
drm: Fix ioc32 compat layer
authorIan Romanick <idr@us.ibm.com>
Thu, 22 Nov 2007 07:02:08 +0000 (17:02 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 7 Feb 2008 05:09:39 +0000 (15:09 +1000)
Previously any ioctls that weren't explicitly listed in the compat ioctl
table would fail with ENOTTY.  If the incoming ioctl number is outside the
range of the table, assume that it Just Works, and pass it off to drm_ioctl.
This make the fence related ioctls work on 64-bit PowerPC.

Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/drm_ioc32.c

index 2286f3312c5c0cbe27d1b4daa3803c1b1279b339..90f5a8d9bdcb67057ecf97301dee8d2f5ceb1566 100644 (file)
@@ -1051,8 +1051,12 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        drm_ioctl_compat_t *fn;
        int ret;
 
+       /* Assume that ioctls without an explicit compat routine will just
+        * work.  This may not always be a good assumption, but it's better
+        * than always failing.
+        */
        if (nr >= ARRAY_SIZE(drm_compat_ioctls))
-               return -ENOTTY;
+               return drm_ioctl(filp->f_dentry->d_inode, filp, cmd, arg);
 
        fn = drm_compat_ioctls[nr];