From b21bb9a874e087a41ce52e21af00251cadf0653f Mon Sep 17 00:00:00 2001 From: anton Date: Tue, 9 Nov 2021 06:25:42 +0000 Subject: [PATCH] The uhidevsubmatch() routine was imported from NetBSD back in 2002 along with the reportid locator. The same locator was removed in 2004 making the routine redundant. ok gnezdo@ mpi@ --- sys/dev/usb/uhidev.c | 18 +++--------------- sys/dev/usb/uhidev.h | 8 +------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index 7e196395d2f..1aafa12d220 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.96 2021/11/08 07:05:21 anton Exp $ */ +/* $OpenBSD: uhidev.c,v 1.97 2021/11/09 06:25:42 anton Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -89,7 +89,6 @@ void uhidev_intr(struct usbd_xfer *, void *, usbd_status); int uhidev_maxrepid(void *buf, int len); int uhidevprint(void *aux, const char *pnp); -int uhidevsubmatch(struct device *parent, void *cf, void *aux); int uhidev_match(struct device *, void *, void *); void uhidev_attach(struct device *, struct device *, void *); @@ -254,7 +253,7 @@ uhidev_attach(struct device *parent, struct device *self, void *aux) uha.claimed = malloc(nrepid, M_TEMP, M_WAITOK|M_ZERO); /* Look for a driver claiming multiple report IDs first. */ - dev = config_found_sm(self, &uha, NULL, uhidevsubmatch); + dev = config_found_sm(self, &uha, NULL, NULL); if (dev != NULL) { for (repid = 0; repid < nrepid; repid++) { /* @@ -283,7 +282,7 @@ uhidev_attach(struct device *parent, struct device *self, void *aux) continue; uha.reportid = repid; - dev = config_found_sm(self, &uha, uhidevprint, uhidevsubmatch); + dev = config_found_sm(self, &uha, uhidevprint, NULL); sc->sc_subdevs[repid] = (struct uhidev *)dev; } } @@ -366,17 +365,6 @@ uhidevprint(void *aux, const char *pnp) return (UNCONF); } -int uhidevsubmatch(struct device *parent, void *match, void *aux) -{ - struct uhidev_attach_arg *uha = aux; - struct cfdata *cf = match; - - if (cf->uhidevcf_reportid != UHIDEV_UNK_REPORTID && - cf->uhidevcf_reportid != uha->reportid) - return (0); - return ((*cf->cf_attach->ca_match)(parent, cf, aux)); -} - int uhidev_activate(struct device *self, int act) { diff --git a/sys/dev/usb/uhidev.h b/sys/dev/usb/uhidev.h index 6ce75b1f49d..abc78dc72aa 100644 --- a/sys/dev/usb/uhidev.h +++ b/sys/dev/usb/uhidev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.h,v 1.34 2021/10/30 11:56:19 ratchov Exp $ */ +/* $OpenBSD: uhidev.h,v 1.35 2021/11/09 06:25:42 anton Exp $ */ /* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */ /* @@ -31,12 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#define UHIDBUSCF_REPORTID 0 -#define UHIDBUSCF_REPORTID_DEFAULT -1 - -#define uhidevcf_reportid cf_loc[UHIDBUSCF_REPORTID] -#define UHIDEV_UNK_REPORTID UHIDBUSCF_REPORTID_DEFAULT - struct uhidev_softc { struct device sc_dev; /* base device */ struct usbd_device *sc_udev; -- 2.20.1