From: mglocker Date: Mon, 31 May 2021 21:06:48 +0000 (+0000) Subject: Change the behavior of the UVIDEO_FLAG_REATTACH flag to attach an X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2966318bd2ad13b3cc102da32390353567598a10;p=openbsd 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@ --- 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 @@ -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