projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
tty
/
tty_buffer.c
diff --git
a/drivers/tty/tty_buffer.c
b/drivers/tty/tty_buffer.c
index 143deb62467d57a1f1216d3f418c2bfccb72201c..3605103fc1ac6d891f255fea127f6fbd8b6ad96b 100644
(file)
--- a/
drivers/tty/tty_buffer.c
+++ b/
drivers/tty/tty_buffer.c
@@
-202,14
+202,16
@@
static void tty_buffer_free(struct tty_port *port, struct tty_buffer *b)
/**
* tty_buffer_flush - flush full tty buffers
* @tty: tty to flush
/**
* tty_buffer_flush - flush full tty buffers
* @tty: tty to flush
+ * @ld: optional ldisc ptr (must be referenced)
*
*
- * flush all the buffers containing receive data.
+ * flush all the buffers containing receive data. If ld != NULL,
+ * flush the ldisc input buffer.
*
* Locking: takes buffer lock to ensure single-threaded flip buffer
* 'consumer'
*/
*
* Locking: takes buffer lock to ensure single-threaded flip buffer
* 'consumer'
*/
-void tty_buffer_flush(struct tty_struct *tty)
+void tty_buffer_flush(struct tty_struct *tty
, struct tty_ldisc *ld
)
{
struct tty_port *port = tty->port;
struct tty_bufhead *buf = &port->buf;
{
struct tty_port *port = tty->port;
struct tty_bufhead *buf = &port->buf;
@@
-223,6
+225,10
@@
void tty_buffer_flush(struct tty_struct *tty)
buf->head = next;
}
buf->head->read = buf->head->commit;
buf->head = next;
}
buf->head->read = buf->head->commit;
+
+ if (ld && ld->ops->flush_buffer)
+ ld->ops->flush_buffer(tty);
+
atomic_dec(&buf->priority);
mutex_unlock(&buf->lock);
}
atomic_dec(&buf->priority);
mutex_unlock(&buf->lock);
}