]> Git Repo - linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
authorLinus Torvalds <[email protected]>
Sun, 20 Sep 2009 22:55:39 +0000 (15:55 -0700)
committerLinus Torvalds <[email protected]>
Sun, 20 Sep 2009 22:55:39 +0000 (15:55 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
  Driver-Core: extend devnode callbacks to provide permissions

1  2 
drivers/char/tty_io.c

diff --combined drivers/char/tty_io.c
index 05f443c47bbe528f45689b6da01bf3add1e1a8b6,c70d9dabefaea4e35883475a0038b49459ee98d4..ea18a129b0b556898a01ed8c6740ef343e9cc846
@@@ -1184,7 -1184,6 +1184,7 @@@ int tty_init_termios(struct tty_struct 
        tty->termios->c_ospeed = tty_termios_baud_rate(tty->termios);
        return 0;
  }
 +EXPORT_SYMBOL_GPL(tty_init_termios);
  
  /**
   *    tty_driver_install_tty() - install a tty entry in the driver
@@@ -1387,14 -1386,10 +1387,14 @@@ EXPORT_SYMBOL(tty_shutdown)
   *            tty_mutex - sometimes only
   *            takes the file list lock internally when working on the list
   *    of ttys that the driver keeps.
 + *
 + *    This method gets called from a work queue so that the driver private
 + *    shutdown ops can sleep (needed for USB at least)
   */
 -static void release_one_tty(struct kref *kref)
 +static void release_one_tty(struct work_struct *work)
  {
 -      struct tty_struct *tty = container_of(kref, struct tty_struct, kref);
 +      struct tty_struct *tty =
 +              container_of(work, struct tty_struct, hangup_work);
        struct tty_driver *driver = tty->driver;
  
        if (tty->ops->shutdown)
        free_tty_struct(tty);
  }
  
 +static void queue_release_one_tty(struct kref *kref)
 +{
 +      struct tty_struct *tty = container_of(kref, struct tty_struct, kref);
 +      /* The hangup queue is now free so we can reuse it rather than
 +         waste a chunk of memory for each port */
 +      INIT_WORK(&tty->hangup_work, release_one_tty);
 +      schedule_work(&tty->hangup_work);
 +}
 +
  /**
   *    tty_kref_put            -       release a tty kref
   *    @tty: tty device
  void tty_kref_put(struct tty_struct *tty)
  {
        if (tty)
 -              kref_put(&tty->kref, release_one_tty);
 +              kref_put(&tty->kref, queue_release_one_tty);
  }
  EXPORT_SYMBOL(tty_kref_put);
  
@@@ -2099,7 -2085,7 +2099,7 @@@ static int tioccons(struct file *file
   *    the generic functionality existed. This piece of history is preserved
   *    in the expected tty API of posix OS's.
   *
 - *    Locking: none, the open fle handle ensures it won't go away.
 + *    Locking: none, the open file handle ensures it won't go away.
   */
  
  static int fionbio(struct file *file, int __user *p)
@@@ -3070,11 -3056,22 +3070,22 @@@ void __init console_init(void
        }
  }
  
+ static char *tty_devnode(struct device *dev, mode_t *mode)
+ {
+       if (!mode)
+               return NULL;
+       if (dev->devt == MKDEV(TTYAUX_MAJOR, 0) ||
+           dev->devt == MKDEV(TTYAUX_MAJOR, 2))
+               *mode = 0666;
+       return NULL;
+ }
  static int __init tty_class_init(void)
  {
        tty_class = class_create(THIS_MODULE, "tty");
        if (IS_ERR(tty_class))
                return PTR_ERR(tty_class);
+       tty_class->devnode = tty_devnode;
        return 0;
  }
  
This page took 0.095642 seconds and 4 git commands to generate.