diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-07-30 21:36:55 +0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-07-30 21:36:55 +0400 |
| commit | bc588df79ebfb710abc27342fccf336a68ed1216 (patch) | |
| tree | e50e125eaa6da83fa715704e53c1bde013d1ef8e /drivers/char/ppdev.c | |
| parent | bce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff) | |
| parent | 15dd859cacf312f606f54502d1f66537a1e5c78c (diff) | |
| download | linux-bc588df79ebfb710abc27342fccf336a68ed1216.tar.xz | |
Merge branch 'x86/core' into x86/xsave
Diffstat (limited to 'drivers/char/ppdev.c')
| -rw-r--r-- | drivers/char/ppdev.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 3aab837d9480..bee39fdfba73 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -66,7 +66,8 @@ #include <linux/poll.h> #include <linux/major.h> #include <linux/ppdev.h> -#include <asm/uaccess.h> +#include <linux/smp_lock.h> +#include <linux/uaccess.h> #define PP_VERSION "ppdev: user-space parallel port driver" #define CHRDEV "ppdev" @@ -327,10 +328,9 @@ static enum ieee1284_phase init_phase (int mode) return IEEE1284_PH_FWD_IDLE; } -static int pp_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) +static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - unsigned int minor = iminor(inode); + unsigned int minor = iminor(file->f_path.dentry->d_inode); struct pp_struct *pp = file->private_data; struct parport * port; void __user *argp = (void __user *)arg; @@ -633,11 +633,21 @@ static int pp_ioctl(struct inode *inode, struct file *file, return 0; } +static long pp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + long ret; + lock_kernel(); + ret = pp_do_ioctl(file, cmd, arg); + unlock_kernel(); + return ret; +} + static int pp_open (struct inode * inode, struct file * file) { unsigned int minor = iminor(inode); struct pp_struct *pp; + cycle_kernel_lock(); if (minor >= PARPORT_MAX) return -ENXIO; @@ -743,15 +753,16 @@ static const struct file_operations pp_fops = { .read = pp_read, .write = pp_write, .poll = pp_poll, - .ioctl = pp_ioctl, + .unlocked_ioctl = pp_ioctl, .open = pp_open, .release = pp_release, }; static void pp_attach(struct parport *port) { - device_create(ppdev_class, port->dev, MKDEV(PP_MAJOR, port->number), - "parport%d", port->number); + device_create_drvdata(ppdev_class, port->dev, + MKDEV(PP_MAJOR, port->number), + NULL, "parport%d", port->number); } static void pp_detach(struct parport *port) |
