From: anton Date: Thu, 18 Mar 2021 09:21:53 +0000 (+0000) Subject: In revision 1.91 of uhidev.c, jcs@ made sure to only detach devices X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=59a500d93d9cd576862f9394afd9ec710b3917f8;p=openbsd In revision 1.91 of uhidev.c, jcs@ made sure to only detach devices claiming multiple report ids once. This allows uhidpp to piggy back on the same functionality making uhidev_unset_report_dev() redundant. --- diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index b3f5f4df8ee..cbd0b8336f6 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.91 2021/03/17 19:44:16 jcs Exp $ */ +/* $OpenBSD: uhidev.c,v 1.92 2021/03/18 09:21:53 anton Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -995,13 +995,3 @@ 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 cb83045084c..ad66873ea75 100644 --- a/sys/dev/usb/uhidev.h +++ b/sys/dev/usb/uhidev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.h,v 1.28 2021/03/08 14:35:57 jcs Exp $ */ +/* $OpenBSD: uhidev.h,v 1.29 2021/03/18 09:21:53 anton Exp $ */ /* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */ /* @@ -98,4 +98,3 @@ 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); diff --git a/sys/dev/usb/uhidpp.c b/sys/dev/usb/uhidpp.c index b24fa47f403..07a64ed67a4 100644 --- a/sys/dev/usb/uhidpp.c +++ b/sys/dev/usb/uhidpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidpp.c,v 1.12 2021/02/16 18:36:43 anton Exp $ */ +/* $OpenBSD: uhidpp.c,v 1.13 2021/03/18 09:21:53 anton Exp $ */ /* * Copyright (c) 2021 Anton Lindqvist @@ -434,14 +434,6 @@ uhidpp_detach(struct device *self, int flags) sensor_detach(&sc->sc_sensdev, &dev->d_battery.b_sens[j]); } - /* - * Since this driver has multiple device handlers attached, remove all - * of them preventing the uhidev parent from calling this detach routine - * more than once. - */ - uhidev_unset_report_dev(sc->sc_hdev.sc_parent, HIDPP_REPORT_ID_SHORT); - uhidev_unset_report_dev(sc->sc_hdev.sc_parent, HIDPP_REPORT_ID_LONG); - uhidev_close(&sc->sc_hdev); return 0;