From 51b434999bcfd33111ee4584127f9d423ba00594 Mon Sep 17 00:00:00 2001 From: guillemj <> Date: Fri, 27 May 2011 05:11:10 +0000 Subject: [PATCH] Use .unlocked_ioctl file operations member when .ioctl is not present --- Device3Dfx/3dfx_driver.c | 13 +++++++++++++ Device3Dfx/ChangeLog | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/Device3Dfx/3dfx_driver.c b/Device3Dfx/3dfx_driver.c index 71b4f4d..e2a3c35 100644 --- a/Device3Dfx/3dfx_driver.c +++ b/Device3Dfx/3dfx_driver.c @@ -641,9 +641,18 @@ static int doPIO(unsigned int cmd, unsigned long arg) return -EINVAL; } +#ifdef HAVE_UNLOCKED_IOCTL +static long ioctl_3dfx(struct file *file, unsigned int cmd, unsigned long arg) +#else static int ioctl_3dfx(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +#endif { +#ifdef HAVE_UNLOCKED_IOCTL + DEBUGMSG(("3dfx: Entering ioctl_3dfx, file %p cmd %x arg %lx\n", + file, cmd, arg)); +#else DEBUGMSG(("3dfx: Entering ioctl_3dfx, inode %p file %p cmd %x arg %lx\n", inode, file, cmd, arg)); +#endif switch (_IOC_TYPE(cmd)) { case '3': @@ -777,7 +786,11 @@ static struct file_operations fops_3dfx = { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) .owner = THIS_MODULE, #endif +#ifdef HAVE_UNLOCKED_IOCTL + .unlocked_ioctl = ioctl_3dfx, +#else .ioctl = ioctl_3dfx, +#endif .mmap = mmap_3dfx, .open = open_3dfx, .release = release_3dfx, diff --git a/Device3Dfx/ChangeLog b/Device3Dfx/ChangeLog index d597114..0c195e7 100644 --- a/Device3Dfx/ChangeLog +++ b/Device3Dfx/ChangeLog @@ -1,3 +1,10 @@ +2011-05-27 Guillem Jover + + * 3dfx_driver.c [HAVE_UNLOCKED_IOCTL] (ioctl_3dfx): Use new + prototype for unlocked_ioctl. + (fops_3dfx) [HAVE_UNLOCKED_IOCTL]: Assign ioctl_3dfx to + .unlocked_ioctl instead of .ioctl. + 2011-05-27 Guillem Jover * 3dfx_driver.c: On Linux >= 2.6.33, use