Merge tag 'perf-tools-for-v5.14-2021-07-10' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-microblaze.git] / drivers / tty / tty_port.c
index 303c198..2f1061a 100644 (file)
@@ -468,7 +468,8 @@ int tty_port_block_til_ready(struct tty_port *port,
        DEFINE_WAIT(wait);
 
        /* if non-blocking mode is set we can pass directly to open unless
-          the port has just hung up or is in another error state */
+        * the port has just hung up or is in another error state.
+        */
        if (tty_io_error(tty)) {
                tty_port_set_active(port, 1);
                return 0;
@@ -485,8 +486,9 @@ int tty_port_block_til_ready(struct tty_port *port,
                do_clocal = 1;
 
        /* Block waiting until we can proceed. We may need to wait for the
-          carrier, but we must also wait for any close that is in progress
-          before the next open may complete */
+        * carrier, but we must also wait for any close that is in progress
+        * before the next open may complete.
+        */
 
        retval = 0;
 
@@ -503,7 +505,8 @@ int tty_port_block_til_ready(struct tty_port *port,
 
                prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE);
                /* Check for a hangup or uninitialised port.
-                                                       Return accordingly */
+                * Return accordingly.
+                */
                if (tty_hung_up_p(filp) || !tty_port_initialized(port)) {
                        if (port->flags & ASYNC_HUP_NOTIFY)
                                retval = -EAGAIN;
@@ -530,7 +533,8 @@ int tty_port_block_til_ready(struct tty_port *port,
        finish_wait(&port->open_wait, &wait);
 
        /* Update counts. A parallel hangup will have set count to zero and
-          we must not mess that up further */
+        * we must not mess that up further.
+        */
        spin_lock_irqsave(&port->lock, flags);
        if (!tty_hung_up_p(filp))
                port->count++;
@@ -587,7 +591,7 @@ int tty_port_close_start(struct tty_port *port,
 
        if (tty_port_initialized(port)) {
                /* Don't block on a stalled port, just pull the chain */
-               if (tty->flow_stopped)
+               if (tty->flow.tco_stopped)
                        tty_driver_flush_buffer(tty);
                if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
                        tty_wait_until_sent(tty, port->closing_wait);
@@ -688,6 +692,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
                clear_bit(TTY_IO_ERROR, &tty->flags);
                if (port->ops->activate) {
                        int retval = port->ops->activate(port, tty);
+
                        if (retval) {
                                mutex_unlock(&port->mutex);
                                return retval;
@@ -698,5 +703,4 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
        mutex_unlock(&port->mutex);
        return tty_port_block_til_ready(port, tty, filp);
 }
-
 EXPORT_SYMBOL(tty_port_open);