[issue1866] [PATCH] ucom - destroy device node on detach

YONETANI Tomokazu qhwt.dfly at les.ath.cx
Wed Oct 6 21:10:29 PDT 2010


> Hey,

Hi,

> Just for readability, I think it would be better not to have two = on the same 
> line here.

Well, it's common in C for assigning the same value to multiple variables
that way, but I don't insist on that point here :)
I'm going to commit this in a few days if no objections raised.

Cheers.

diff --git a/sys/dev/usbmisc/ucom/ucom.c b/sys/dev/usbmisc/ucom/ucom.c
index f85c3b7..66ccc53 100644
--- a/sys/dev/usbmisc/ucom/ucom.c
+++ b/sys/dev/usbmisc/ucom/ucom.c
@@ -181,6 +181,7 @@ ucom_attach(struct ucom_softc *sc)
 			UID_UUCP, GID_DIALER, 0660,
 			"ucom%d", unit);
 	dev->si_tty = tp;
+	sc->dev = dev;
 	lwkt_reltoken(&tty_token);
 
 	return (0);
@@ -194,6 +195,7 @@ ucom_detach(struct ucom_softc *sc)
 
 	DPRINTF(("ucom_detach: sc = %p, tp = %p\n", sc, sc->sc_tty));
 
+	destroy_dev(sc->dev);
 	lwkt_gettoken(&tty_token);
 	sc->sc_dying = 1;
 
-- 
1.7.0.5






More information about the Submit mailing list