summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2008-10-04 11:54:44 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2008-10-04 11:54:44 +0000
commitdc12fe5cab2ff57a5e25f35435e33fd11117fc72 (patch)
treeefe39c55196649735776fdcf56687581c3b8da0d
parentc56128759d653dbccb268315e12a54b806e7e9d3 (diff)
When closing the video stream switch back to default interface as last
action. Shuts down the device gracefully.
-rw-r--r--sys/dev/usb/uvideo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 0c6d8a402fe..55179385b99 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.85 2008/08/24 19:46:45 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.86 2008/10/04 11:54:43 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -1466,14 +1466,14 @@ uvideo_vs_open(struct uvideo_softc *sc)
void
uvideo_vs_close(struct uvideo_softc *sc)
{
- /* switch back to default interface (turns off cam LED) */
- (void)usbd_set_interface(sc->sc_vs_cur->ifaceh, 0);
-
if (sc->sc_vs_cur->pipeh) {
usbd_abort_pipe(sc->sc_vs_cur->pipeh);
usbd_close_pipe(sc->sc_vs_cur->pipeh);
sc->sc_vs_cur->pipeh = NULL;
}
+
+ /* switch back to default interface (turns off cam LED) */
+ (void)usbd_set_interface(sc->sc_vs_cur->ifaceh, 0);
}
usbd_status