Hi,
The uhidevsubmatch() routine was imported from NetBSD back in 2002[1] along with
the reportid locator. The same locator was removed in 2004[2] making
this routine and its defines redundant.

Comments? OK?

[1] 
https://github.com/openbsd/src/commit/a66cb31e58a16ed957a52ce1b92aafc08fc4900d
[2] 
https://github.com/openbsd/src/commit/cd0cdd200650f714bb35984fcf257b23b34b6f39

diff --git sys/dev/usb/uhidev.c sys/dev/usb/uhidev.c
index b56c00ceceb..d4bd3c5fef9 100644
--- sys/dev/usb/uhidev.c
+++ sys/dev/usb/uhidev.c
@@ -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 *);
@@ -257,7 +256,7 @@ uhidev_attach(struct device *parent, struct device *self, 
void *aux)
                uha.nreports = nrepid;
                uha.claimed = malloc(nrepid, M_TEMP, M_WAITOK|M_ZERO);
 
-               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++) {
                                /*
@@ -290,7 +289,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;
        }
 }
@@ -373,17 +372,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 sys/dev/usb/uhidev.h sys/dev/usb/uhidev.h
index 9ae85e1ab9f..104fe59c8aa 100644
--- sys/dev/usb/uhidev.h
+++ sys/dev/usb/uhidev.h
@@ -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;

Reply via email to