]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/tty/tty_mutex.c
Merge remote-tracking branches 'asoc/topic/fsl-sai', 'asoc/topic/max98926', 'asoc...
[karo-tx-linux.git] / drivers / tty / tty_mutex.c
index 77703a3912075a7b740eb4626a5159d55ea6f57a..d2f3c4cd697f5cd2bae639fd4d88009af5e2733b 100644 (file)
@@ -19,6 +19,14 @@ void __lockfunc tty_lock(struct tty_struct *tty)
 }
 EXPORT_SYMBOL(tty_lock);
 
+int tty_lock_interruptible(struct tty_struct *tty)
+{
+       if (WARN(tty->magic != TTY_MAGIC, "L Bad %p\n", tty))
+               return -EIO;
+       tty_kref_get(tty);
+       return mutex_lock_interruptible(&tty->legacy_mutex);
+}
+
 void __lockfunc tty_unlock(struct tty_struct *tty)
 {
        if (WARN(tty->magic != TTY_MAGIC, "U Bad %p\n", tty))