- unsigned long flags;
- int rc, doclocal;
- struct tty_port *port = &portp->port;
-
- pr_debug("stl_waitcarrier(portp=%p,filp=%p)\n", portp, filp);
-
- rc = 0;
- doclocal = 0;
-
- spin_lock_irqsave(&stallion_lock, flags);
-
- if (tty->termios->c_cflag & CLOCAL)
- doclocal++;
-
- portp->openwaitcnt++;
- if (! tty_hung_up_p(filp))
- port->count--;
-
- for (;;) {
- /* Takes brd_lock internally */
- stl_setsignals(portp, 1, 1);
- if (tty_hung_up_p(filp) ||
- ((port->flags & ASYNC_INITIALIZED) == 0)) {
- if (port->flags & ASYNC_HUP_NOTIFY)
- rc = -EBUSY;
- else
- rc = -ERESTARTSYS;
- break;
- }
- if (((port->flags & ASYNC_CLOSING) == 0) &&
- (doclocal || tty_port_carrier_raised(port)))
- break;
- if (signal_pending(current)) {
- rc = -ERESTARTSYS;
- break;
- }
- /* FIXME */
- interruptible_sleep_on(&port->open_wait);
- }
-
- if (! tty_hung_up_p(filp))
- port->count++;
- portp->openwaitcnt--;
- spin_unlock_irqrestore(&stallion_lock, flags);
-
- return rc;
+ struct stlport *portp = container_of(port, struct stlport, port);
+ /* Takes brd_lock internally */
+ stl_setsignals(portp, 1, 1);