summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2021-05-31 21:06:49 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2021-05-31 21:06:49 +0000
commit2dc6122a337b263e3d449227bfb5af6bbeaf0f94 (patch)
tree718dac29b0148929eb247db177f91dfc4b4d17dd /sys/dev/usb
parent8f624504b736327d65c242b1e85c9e5c909d9ae7 (diff)
Change the behavior of the UVIDEO_FLAG_REATTACH flag to attach an
unsupported device to uvideo(4), but not to video(1), instead of just keeping it unmatched. Also uvideo(4) will print a message about the device not being supported. ok mpi@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/uvideo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 79297d8935f..1b3788de1d2 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.212 2021/04/05 20:45:49 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.213 2021/05/31 21:06:48 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -490,9 +490,6 @@ uvideo_match(struct device *parent, void *match, void *aux)
/* quirk devices */
quirk = uvideo_lookup(uaa->vendor, uaa->product);
if (quirk != NULL) {
- if (quirk->flags & UVIDEO_FLAG_NOATTACH)
- return (UMATCH_NONE);
-
if (quirk->flags & UVIDEO_FLAG_REATTACH)
return (UMATCH_VENDOR_PRODUCT_CONF_IFACE);
@@ -578,6 +575,11 @@ uvideo_attach(struct device *parent, struct device *self, void *aux)
/* maybe the device has quirks */
sc->sc_quirk = uvideo_lookup(uaa->vendor, uaa->product);
+ if (sc->sc_quirk && sc->sc_quirk->flags & UVIDEO_FLAG_NOATTACH) {
+ printf("%s: device not supported\n", DEVNAME(sc));
+ return;
+ }
+
if (sc->sc_quirk && sc->sc_quirk->ucode_name)
config_mountroot(self, uvideo_attach_hook);
else