diff options
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 39c8514442eb..8a549db2aa78 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <linux/module.h> | 48 | #include <linux/module.h> |
49 | #include <linux/types.h> | 49 | #include <linux/types.h> |
50 | #include <linux/kernel.h> | 50 | #include <linux/kernel.h> |
51 | #include <linux/compat.h> | ||
51 | #include <linux/kthread.h> | 52 | #include <linux/kthread.h> |
52 | #include <linux/errno.h> | 53 | #include <linux/errno.h> |
53 | #include <linux/spinlock.h> | 54 | #include <linux/spinlock.h> |
@@ -57,6 +58,7 @@ | |||
57 | #include <linux/miscdevice.h> | 58 | #include <linux/miscdevice.h> |
58 | #include <linux/freezer.h> | 59 | #include <linux/freezer.h> |
59 | #include <linux/mutex.h> | 60 | #include <linux/mutex.h> |
61 | #include <linux/slab.h> | ||
60 | #include <scsi/scsi_cmnd.h> | 62 | #include <scsi/scsi_cmnd.h> |
61 | #include <scsi/scsi_ioctl.h> | 63 | #include <scsi/scsi_ioctl.h> |
62 | #include <scsi/scsi.h> | 64 | #include <scsi/scsi.h> |
@@ -2983,7 +2985,7 @@ static void pkt_get_status(struct pkt_ctrl_command *ctrl_cmd) | |||
2983 | mutex_unlock(&ctl_mutex); | 2985 | mutex_unlock(&ctl_mutex); |
2984 | } | 2986 | } |
2985 | 2987 | ||
2986 | static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 2988 | static long pkt_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
2987 | { | 2989 | { |
2988 | void __user *argp = (void __user *)arg; | 2990 | void __user *argp = (void __user *)arg; |
2989 | struct pkt_ctrl_command ctrl_cmd; | 2991 | struct pkt_ctrl_command ctrl_cmd; |
@@ -3020,10 +3022,20 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm | |||
3020 | return ret; | 3022 | return ret; |
3021 | } | 3023 | } |
3022 | 3024 | ||
3025 | #ifdef CONFIG_COMPAT | ||
3026 | static long pkt_ctl_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | ||
3027 | { | ||
3028 | return pkt_ctl_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); | ||
3029 | } | ||
3030 | #endif | ||
3023 | 3031 | ||
3024 | static const struct file_operations pkt_ctl_fops = { | 3032 | static const struct file_operations pkt_ctl_fops = { |
3025 | .ioctl = pkt_ctl_ioctl, | 3033 | .open = nonseekable_open, |
3026 | .owner = THIS_MODULE, | 3034 | .unlocked_ioctl = pkt_ctl_ioctl, |
3035 | #ifdef CONFIG_COMPAT | ||
3036 | .compat_ioctl = pkt_ctl_compat_ioctl, | ||
3037 | #endif | ||
3038 | .owner = THIS_MODULE, | ||
3027 | }; | 3039 | }; |
3028 | 3040 | ||
3029 | static struct miscdevice pkt_misc = { | 3041 | static struct miscdevice pkt_misc = { |