summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpirofti <pirofti@openbsd.org>2013-11-07 11:14:26 +0000
committerpirofti <pirofti@openbsd.org>2013-11-07 11:14:26 +0000
commitd4be7f5bbee876d311f9914e4c51462b617c13fc (patch)
tree469f73c71d9a3b2fd52b9b551d99f7c9e1b40f7a
parentReplace sc_dying in favour of usbd_is_dying() and usbd_deactivate(). (diff)
downloadwireguard-openbsd-d4be7f5bbee876d311f9914e4c51462b617c13fc.tar.xz
wireguard-openbsd-d4be7f5bbee876d311f9914e4c51462b617c13fc.zip
Replace sc_dying in favour of usbd_is_dying() and usbd_deactivate().
Tested and okay mpi@.
-rw-r--r--sys/dev/usb/uvideo.c10
-rw-r--r--sys/dev/usb/uvideo.h3
2 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 5180d37d8f3..84f9f3fdf69 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.172 2013/04/26 14:53:19 mpi Exp $ */
+/* $OpenBSD: uvideo.c,v 1.173 2013/11/07 11:14:26 pirofti Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -336,7 +336,7 @@ uvideo_enable(void *v)
DPRINTF(1, "%s: uvideo_enable sc=%p\n", DEVNAME(sc), sc);
- if (sc->sc_dying)
+ if (usbd_is_dying(sc->sc_udev))
return (EIO);
if (sc->sc_enabled)
@@ -370,7 +370,7 @@ uvideo_open(void *addr, int flags, int *size, uint8_t *buffer,
DPRINTF(1, "%s: uvideo_open: sc=%p\n", DEVNAME(sc), sc);
- if (sc->sc_dying)
+ if (usbd_is_dying(sc->sc_udev))
return (EIO);
/* pointers to upper video layer */
@@ -568,7 +568,7 @@ uvideo_activate(struct device *self, int act)
case DVACT_DEACTIVATE:
if (sc->sc_videodev != NULL)
config_deactivate(sc->sc_videodev);
- sc->sc_dying = 1;
+ usbd_deactivate(sc->sc_udev);
break;
}
@@ -1929,7 +1929,7 @@ uvideo_vs_start_isoc_ixfer(struct uvideo_softc *sc,
DPRINTF(2, "%s: %s\n", DEVNAME(sc), __func__);
- if (sc->sc_dying)
+ if (usbd_is_dying(sc->sc_udev))
return;
for (i = 0; i < sc->sc_nframes; i++)
diff --git a/sys/dev/usb/uvideo.h b/sys/dev/usb/uvideo.h
index 6036228708e..54c477e2c72 100644
--- a/sys/dev/usb/uvideo.h
+++ b/sys/dev/usb/uvideo.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.h,v 1.55 2013/04/15 09:23:02 mglocker Exp $ */
+/* $OpenBSD: uvideo.h,v 1.56 2013/11/07 11:14:26 pirofti Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
@@ -668,7 +668,6 @@ struct uvideo_softc {
struct device *sc_videodev;
int sc_enabled;
- int sc_dying;
int sc_max_fbuf_size;
int sc_negotiated_flag;
int sc_frame_rate;