string: factorize skip_spaces and export it to be generally available
[safe/jmp/linux-2.6] / include / linux / tty_driver.h
index 8615d66..b086779 100644 (file)
  *
  * void (*shutdown)(struct tty_struct * tty);
  *
- *     This routine is called when a particular tty device is closed for
- *     the last time freeing up the resources.
+ *     This routine is called synchronously when a particular tty device
+ *     is closed for the last time freeing up the resources.
+ *
+ *
+ * void (*cleanup)(struct tty_struct * tty);
+ *
+ *     This routine is called asynchronously when a particular tty device
+ *     is closed for the last time freeing up the resources. This is
+ *     actually the second part of shutdown for routines that might sleep.
+ *
  *
  * int (*write)(struct tty_struct * tty,
  *              const unsigned char *buf, int count);
  *     the line discipline are close to full, and it should somehow
  *     signal that no more characters should be sent to the tty.
  *
- *     Optional: Always invoke via tty_throttle();
+ *     Optional: Always invoke via tty_throttle(), called under the
+ *     termios lock.
  * 
  * void (*unthrottle)(struct tty_struct * tty);
  *
  *     that characters can now be sent to the tty without fear of
  *     overrunning the input buffers of the line disciplines.
  * 
- *     Optional: Always invoke via tty_unthrottle();
+ *     Optional: Always invoke via tty_unthrottle(), called under the
+ *     termios lock.
  *
  * void (*stop)(struct tty_struct *tty);
  *
@@ -231,6 +241,7 @@ struct tty_operations {
        int  (*open)(struct tty_struct * tty, struct file * filp);
        void (*close)(struct tty_struct * tty, struct file * filp);
        void (*shutdown)(struct tty_struct *tty);
+       void (*cleanup)(struct tty_struct *tty);
        int  (*write)(struct tty_struct * tty,
                      const unsigned char *buf, int count);
        int  (*put_char)(struct tty_struct *tty, unsigned char ch);
@@ -309,7 +320,8 @@ extern void tty_set_operations(struct tty_driver *driver,
 extern struct tty_driver *tty_find_polling_driver(char *name, int *line);
 
 extern void tty_driver_kref_put(struct tty_driver *driver);
-extern inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
+
+static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d)
 {
        kref_get(&d->kref);
        return d;