tty: phase out of ioctl file pointer for tty3270 as well
[deliverable/linux.git] / drivers / s390 / char / tty3270.c
index 38385677c65380e45730b42b8af38d78c9f8ac50..d33554df2b0678318e3434fd960c3a2374e1e064 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <linux/slab.h>
 #include <linux/bootmem.h>
+#include <linux/compat.h>
 
 #include <asm/ccwdev.h>
 #include <asm/cio.h>
@@ -1717,9 +1718,22 @@ tty3270_wait_until_sent(struct tty_struct *tty, int timeout)
 {
 }
 
-static int
-tty3270_ioctl(struct tty_struct *tty, struct file *file,
-             unsigned int cmd, unsigned long arg)
+static int tty3270_ioctl(struct tty_struct *tty, unsigned int cmd,
+                        unsigned long arg)
+{
+       struct tty3270 *tp;
+
+       tp = tty->driver_data;
+       if (!tp)
+               return -ENODEV;
+       if (tty->flags & (1 << TTY_IO_ERROR))
+               return -EIO;
+       return kbd_ioctl(tp->kbd, cmd, arg);
+}
+
+#ifdef CONFIG_COMPAT
+static long tty3270_compat_ioctl(struct tty_struct *tty,
+                                unsigned int cmd, unsigned long arg)
 {
        struct tty3270 *tp;
 
@@ -1728,8 +1742,9 @@ tty3270_ioctl(struct tty_struct *tty, struct file *file,
                return -ENODEV;
        if (tty->flags & (1 << TTY_IO_ERROR))
                return -EIO;
-       return kbd_ioctl(tp->kbd, file, cmd, arg);
+       return kbd_ioctl(tp->kbd, cmd, (unsigned long)compat_ptr(arg));
 }
+#endif
 
 static const struct tty_operations tty3270_ops = {
        .open = tty3270_open,
@@ -1745,6 +1760,9 @@ static const struct tty_operations tty3270_ops = {
        .hangup = tty3270_hangup,
        .wait_until_sent = tty3270_wait_until_sent,
        .ioctl = tty3270_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = tty3270_compat_ioctl,
+#endif
        .set_termios = tty3270_set_termios
 };
 
This page took 0.02833 seconds and 5 git commands to generate.