summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-23 10:28:09 +0000
committerphk <phk@FreeBSD.org>2004-06-23 10:28:09 +0000
commit347e6a87e35f614c66320286399652f5e3aab2c6 (patch)
treee45dcf3b514a5d2d5430e3e24b7f46864436291e /sys/dev/uart
parent01e37606dd447ab904e25c1cfb1edc9f59efe997 (diff)
downloadFreeBSD-src-347e6a87e35f614c66320286399652f5e3aab2c6.zip
FreeBSD-src-347e6a87e35f614c66320286399652f5e3aab2c6.tar.gz
save a few redundant lines by moving the retry loop further backwards.
Diffstat (limited to 'sys/dev/uart')
-rw-r--r--sys/dev/uart/uart_tty.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c
index ec10696..e1c8468 100644
--- a/sys/dev/uart/uart_tty.c
+++ b/sys/dev/uart/uart_tty.c
@@ -367,13 +367,13 @@ uart_tty_open(struct cdev *dev, int flags, int mode, struct thread *td)
struct tty *tp;
int error;
+ loop:
sc = dev->si_drv1;
if (sc == NULL || sc->sc_leaving)
return (ENODEV);
tp = dev->si_tty;
- loop:
if (sc->sc_opened) {
KASSERT(tp->t_state & TS_ISOPEN, ("foo"));
/*
@@ -390,9 +390,6 @@ uart_tty_open(struct cdev *dev, int flags, int mode, struct thread *td)
error = tsleep(sc, TTIPRI|PCATCH, "uartbi", 0);
if (error)
return (error);
- sc = dev->si_drv1;
- if (sc == NULL || sc->sc_leaving)
- return (ENODEV);
goto loop;
}
}
@@ -432,9 +429,6 @@ uart_tty_open(struct cdev *dev, int flags, int mode, struct thread *td)
error = tsleep(TSA_CARR_ON(tp), TTIPRI|PCATCH, "uartdcd", 0);
if (error)
return (error);
- sc = dev->si_drv1;
- if (sc == NULL || sc->sc_leaving)
- return (ENODEV);
goto loop;
}
error = ttyopen(dev, tp);
OpenPOWER on IntegriCloud