aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 90b4fdc8a61f..1c3316a47d7e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -208,7 +208,7 @@ struct tty_port {
208 wait_queue_head_t delta_msr_wait; /* Modem status change */ 208 wait_queue_head_t delta_msr_wait; /* Modem status change */
209 unsigned long flags; /* TTY flags ASY_*/ 209 unsigned long flags; /* TTY flags ASY_*/
210 unsigned char console:1, /* port is a console */ 210 unsigned char console:1, /* port is a console */
211 low_latency:1; /* direct buffer flush */ 211 low_latency:1; /* optional: tune for latency */
212 struct mutex mutex; /* Locking */ 212 struct mutex mutex; /* Locking */
213 struct mutex buf_mutex; /* Buffer alloc lock */ 213 struct mutex buf_mutex; /* Buffer alloc lock */
214 unsigned char *xmit_buf; /* Optional buffer */ 214 unsigned char *xmit_buf; /* Optional buffer */
@@ -518,9 +518,9 @@ extern void tty_port_put(struct tty_port *port);
518 518
519static inline struct tty_port *tty_port_get(struct tty_port *port) 519static inline struct tty_port *tty_port_get(struct tty_port *port)
520{ 520{
521 if (port) 521 if (port && kref_get_unless_zero(&port->kref))
522 kref_get(&port->kref); 522 return port;
523 return port; 523 return NULL;
524} 524}
525 525
526/* If the cts flow control is enabled, return true. */ 526/* If the cts flow control is enabled, return true. */