aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBamvor Jian Zhang <bamvor.zhangjian@linaro.org>2016-01-08 02:50:49 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-08 18:00:04 -0500
commit17a3596f2122b4d88dc0efe297aa2de7be1bb31c (patch)
tree645a7bf84204783fed3c760c1cb85482211fa08b /drivers
parent3b9ab374a1e6d3cd6d16231ec6fe11fe2c49a72a (diff)
ppdev: add support for compat ioctl
The arg of ioctl in ppdev is the pointer of integer except the timeval in PPSETTIME, PPGETTIME. Different size of timeval is already supported by the previous patches. So, it is safe to add compat support. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/ppdev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index c03d998731ea..9e98d0153148 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -69,6 +69,7 @@
69#include <linux/ppdev.h> 69#include <linux/ppdev.h>
70#include <linux/mutex.h> 70#include <linux/mutex.h>
71#include <linux/uaccess.h> 71#include <linux/uaccess.h>
72#include <linux/compat.h>
72 73
73#define PP_VERSION "ppdev: user-space parallel port driver" 74#define PP_VERSION "ppdev: user-space parallel port driver"
74#define CHRDEV "ppdev" 75#define CHRDEV "ppdev"
@@ -670,6 +671,14 @@ static long pp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
670 return ret; 671 return ret;
671} 672}
672 673
674#ifdef CONFIG_COMPAT
675static long pp_compat_ioctl(struct file *file, unsigned int cmd,
676 unsigned long arg)
677{
678 return pp_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
679}
680#endif
681
673static int pp_open (struct inode * inode, struct file * file) 682static int pp_open (struct inode * inode, struct file * file)
674{ 683{
675 unsigned int minor = iminor(inode); 684 unsigned int minor = iminor(inode);
@@ -779,6 +788,9 @@ static const struct file_operations pp_fops = {
779 .write = pp_write, 788 .write = pp_write,
780 .poll = pp_poll, 789 .poll = pp_poll,
781 .unlocked_ioctl = pp_ioctl, 790 .unlocked_ioctl = pp_ioctl,
791#ifdef CONFIG_COMPAT
792 .compat_ioctl = pp_compat_ioctl,
793#endif
782 .open = pp_open, 794 .open = pp_open,
783 .release = pp_release, 795 .release = pp_release,
784}; 796};