Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/dev/usb/ustir.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/dev/usb/ustir.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.20.8.2 retrieving revision 1.21 diff -u -p -r1.20.8.2 -r1.21 --- src/sys/dev/usb/ustir.c 2008/03/23 02:04:54 1.20.8.2 +++ src/sys/dev/usb/ustir.c 2007/12/05 17:19:56 1.21 @@ -1,4 +1,4 @@ -/* ustir.c,v 1.20.8.1 2008/01/09 01:54:48 matt Exp */ +/* $NetBSD: ustir.c,v 1.21 2007/12/05 17:19:56 pooka Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "ustir.c,v 1.20.8.1 2008/01/09 01:54:48 matt Exp"); +__KERNEL_RCSID(0, "$NetBSD: ustir.c,v 1.21 2007/12/05 17:19:56 pooka Exp $"); #include #include @@ -288,14 +288,7 @@ ustir_dumpdata(u_int8_t const *data, siz } #endif -int ustir_match(device_t, struct cfdata *, void *); -void ustir_attach(device_t, device_t, void *); -void ustir_childdet(device_t, device_t); -int ustir_detach(device_t, int); -int ustir_activate(device_t, enum devact); -extern struct cfdriver ustir_cd; -CFATTACH_DECL2(ustir, sizeof(struct ustir_softc), ustir_match, - ustir_attach, ustir_detach, ustir_activate, NULL, ustir_childdet); +USB_DECLARE_DRIVER(ustir); USB_MATCH(ustir) { @@ -372,21 +365,10 @@ USB_ATTACH(ustir) ia.ia_handle = sc; sc->sc_child = config_found(self, &ia, ir_print); - selinit(&sc->sc_rd_sel); - selinit(&sc->sc_wr_sel); USB_ATTACH_SUCCESS_RETURN; } -void -ustir_childdet(device_t self, device_t child) -{ - struct ustir_softc *sc = device_private(self); - - KASSERT(sc->sc_child == child); - sc->sc_child = NULL; -} - USB_DETACH(ustir) { USB_DETACH_START(ustir, sc); @@ -423,15 +405,14 @@ USB_DETACH(ustir) } splx(s); - if (sc->sc_child != NULL) + if (sc->sc_child != NULL) { rv = config_detach(sc->sc_child, flags); + sc->sc_child = NULL; + } usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, USBDEV(sc->sc_dev)); - seldestroy(&sc->sc_rd_sel); - seldestroy(&sc->sc_wr_sel); - return rv; } @@ -587,7 +568,7 @@ deframe_rd_ur(struct ustir_softc *sc) case FR_FRAMEOK: sc->sc_ur_framelen = sc->sc_framestate.bufindex; wakeup(&sc->sc_ur_framelen); /* XXX should use flag */ - selnotify(&sc->sc_rd_sel, 0, 0); + selnotify(&sc->sc_rd_sel, 0); return 1; } } @@ -811,7 +792,7 @@ ustir_rd_cb(usbd_xfer_handle xfer, usbd_ /* Wake up for possible output */ wakeup(&sc->sc_wr_buf); - selnotify(&sc->sc_wr_sel, 0, 0); + selnotify(&sc->sc_wr_sel, 0); } } @@ -859,9 +840,9 @@ ustir_start_read(struct ustir_softc *sc) } Static int -ustir_activate(device_t self, enum devact act) +ustir_activate(device_ptr_t self, enum devact act) { - struct ustir_softc *sc = device_private(self); + struct ustir_softc *sc = (struct ustir_softc *)self; int error = 0; switch (act) {