summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2010-11-05 09:06:23 +0000
committern_hibma <n_hibma@FreeBSD.org>2010-11-05 09:06:23 +0000
commitc616357c66bae26e16370042ec1e177e6ab716f6 (patch)
treec170914aa538de866e6df77a59bb5b750c8e4485 /sys/dev
parenta6fddf3306d86666d9f93f9d0a986ca4d19c598f (diff)
downloadFreeBSD-src-c616357c66bae26e16370042ec1e177e6ab716f6.zip
FreeBSD-src-c616357c66bae26e16370042ec1e177e6ab716f6.tar.gz
- Remove an unused entry from the softc (only used in a debugging printf).
- Fix the loop count on detach (causing a panic on detaching a serial dongle). - Increase a buffer in case some driver want extra long tty device names (postfixing the purpose of the tty for example, e.g. u3g.ppp).
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/serial/usb_serial.c10
-rw-r--r--sys/dev/usb/serial/usb_serial.h1
2 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c
index d185977..7ba74d9 100644
--- a/sys/dev/usb/serial/usb_serial.c
+++ b/sys/dev/usb/serial/usb_serial.c
@@ -255,7 +255,7 @@ ucom_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
}
ssc->sc_subunits = subunits;
- for (subunit = 0; subunit != ssc->sc_subunits; subunit++) {
+ for (subunit = 0; subunit < ssc->sc_subunits; subunit++) {
sc[subunit].sc_subunit = subunit;
sc[subunit].sc_super = ssc;
sc[subunit].sc_mtx = mtx;
@@ -270,8 +270,8 @@ ucom_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
sc[subunit].sc_flag |= UCOM_FLAG_ATTACHED;
}
- DPRINTF("tp = %p, unit = %d, subunits = %d, device name subunit 0 = %s\n",
- sc->sc_tty, ssc->sc_unit, ssc->sc_subunits, sc[0].sc_devname);
+ DPRINTF("tp = %p, unit = %d, subunits = %d\n",
+ sc->sc_tty, ssc->sc_unit, ssc->sc_subunits);
return (0);
}
@@ -287,7 +287,7 @@ ucom_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc)
usb_proc_drain(&ssc->sc_tq);
- for (subunit = 0; subunit <= ssc->sc_subunits; subunit++) {
+ for (subunit = 0; subunit < ssc->sc_subunits; subunit++) {
if (sc[subunit].sc_flag & UCOM_FLAG_ATTACHED) {
ucom_detach_tty(&sc[subunit]);
@@ -304,7 +304,7 @@ static int
ucom_attach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc)
{
struct tty *tp;
- char buf[10]; /* temporary TTY device name buffer */
+ char buf[32]; /* temporary TTY device name buffer */
tp = tty_alloc_mutex(&ucom_class, sc, sc->sc_mtx);
if (tp == NULL)
diff --git a/sys/dev/usb/serial/usb_serial.h b/sys/dev/usb/serial/usb_serial.h
index eb2cc8a..d1dbc65 100644
--- a/sys/dev/usb/serial/usb_serial.h
+++ b/sys/dev/usb/serial/usb_serial.h
@@ -160,7 +160,6 @@ struct ucom_softc {
const struct ucom_callback *sc_callback;
struct ucom_super_softc *sc_super;
struct tty *sc_tty;
- char sc_devname[10];
struct mtx *sc_mtx;
void *sc_parent;
uint32_t sc_subunit;
OpenPOWER on IntegriCloud