tty: remove filp from the USB tty ioctls
[linux-2.6-block.git] / drivers / tty / tty_io.c
index 464d09d97873dd535df3d9ce9b481be7fa98db55..83af24ca1e5e2ff683e757707a15955f8a19f436 100644 (file)
@@ -2465,12 +2465,12 @@ out:
  *     Locking: none (up to the driver)
  */
 
-static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p)
+static int tty_tiocmget(struct tty_struct *tty, int __user *p)
 {
        int retval = -EINVAL;
 
        if (tty->ops->tiocmget) {
-               retval = tty->ops->tiocmget(tty, file);
+               retval = tty->ops->tiocmget(tty);
 
                if (retval >= 0)
                        retval = put_user(retval, p);
@@ -2481,7 +2481,6 @@ static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p
 /**
  *     tty_tiocmset            -       set modem status
  *     @tty: tty device
- *     @file: user file pointer
  *     @cmd: command - clear bits, set bits or set all
  *     @p: pointer to desired bits
  *
@@ -2491,7 +2490,7 @@ static int tty_tiocmget(struct tty_struct *tty, struct file *file, int __user *p
  *     Locking: none (up to the driver)
  */
 
-static int tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int cmd,
+static int tty_tiocmset(struct tty_struct *tty, unsigned int cmd,
             unsigned __user *p)
 {
        int retval;
@@ -2518,7 +2517,7 @@ static int tty_tiocmset(struct tty_struct *tty, struct file *file, unsigned int
        }
        set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP;
        clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP;
-       return tty->ops->tiocmset(tty, file, set, clear);
+       return tty->ops->tiocmset(tty, set, clear);
 }
 
 static int tty_tiocgicount(struct tty_struct *tty, void __user *arg)
@@ -2655,11 +2654,11 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                return send_break(tty, arg ? arg*100 : 250);
 
        case TIOCMGET:
-               return tty_tiocmget(tty, file, p);
+               return tty_tiocmget(tty, p);
        case TIOCMSET:
        case TIOCMBIC:
        case TIOCMBIS:
-               return tty_tiocmset(tty, file, cmd, p);
+               return tty_tiocmset(tty, cmd, p);
        case TIOCGICOUNT:
                retval = tty_tiocgicount(tty, p);
                /* For the moment allow fall through to the old method */
@@ -3256,8 +3255,8 @@ static ssize_t show_cons_active(struct device *dev,
        struct console *c;
        ssize_t count = 0;
 
-       acquire_console_sem();
-       for (c = console_drivers; c; c = c->next) {
+       console_lock();
+       for_each_console(c) {
                if (!c->device)
                        continue;
                if (!c->write)
@@ -3271,7 +3270,7 @@ static ssize_t show_cons_active(struct device *dev,
        while (i--)
                count += sprintf(buf + count, "%s%d%c",
                                 cs[i]->name, cs[i]->index, i ? ' ':'\n');
-       release_console_sem();
+       console_unlock();
 
        return count;
 }
@@ -3306,7 +3305,7 @@ int __init tty_init(void)
        if (IS_ERR(consdev))
                consdev = NULL;
        else
-               device_create_file(consdev, &dev_attr_active);
+               WARN_ON(device_create_file(consdev, &dev_attr_active) < 0);
 
 #ifdef CONFIG_VT
        vty_init(&console_fops);