Use .unlocked_ioctl file operations member when .ioctl is not present
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
2011-05-27 Guillem Jover <guillem@hadrons.org>
|
||||
|
||||
* 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 <guillem@hadrons.org>
|
||||
|
||||
* 3dfx_driver.c: On Linux >= 2.6.33, use <generated/autoconf.h>
|
||||
|
||||
Reference in New Issue
Block a user