From: anton Date: Thu, 11 Feb 2021 06:55:10 +0000 (+0000) Subject: Add uhidev_unset_report_dev(), doing the opposite of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6a552525ad76fc146a9666eb870a3cf047124835;p=openbsd Add uhidev_unset_report_dev(), doing the opposite of uhidev_set_report_dev(). Needed by some upcoming changes to uhidpp. ok mglocker@ --- diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index 2999e40cc52..ed072c741d0 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.87 2021/02/11 06:53:44 anton Exp $ */ +/* $OpenBSD: uhidev.c,v 1.88 2021/02/11 06:55:10 anton Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -1013,3 +1013,13 @@ uhidev_set_report_dev(struct uhidev_softc *sc, struct uhidev *dev, int repid) sc->sc_subdevs[repid] = dev; return 0; } + +int +uhidev_unset_report_dev(struct uhidev_softc *sc, int repid) +{ + if (repid >= sc->sc_nrepid) + return EINVAL; + + sc->sc_subdevs[repid] = NULL; + return 0; +} diff --git a/sys/dev/usb/uhidev.h b/sys/dev/usb/uhidev.h index 5caba3d8304..7cce36f515d 100644 --- a/sys/dev/usb/uhidev.h +++ b/sys/dev/usb/uhidev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.h,v 1.26 2021/02/04 16:18:34 anton Exp $ */ +/* $OpenBSD: uhidev.h,v 1.27 2021/02/11 06:55:10 anton Exp $ */ /* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */ /* @@ -96,3 +96,4 @@ int uhidev_get_report_async(struct uhidev_softc *, int, int, void *, int, void *, void (*)(void *, int, void *, int)); usbd_status uhidev_write(struct uhidev_softc *, void *, int); int uhidev_set_report_dev(struct uhidev_softc *, struct uhidev *, int); +int uhidev_unset_report_dev(struct uhidev_softc *, int);