diff options
Diffstat (limited to 'sys/dev/usb/if_rsu.c')
-rw-r--r-- | sys/dev/usb/if_rsu.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/dev/usb/if_rsu.c b/sys/dev/usb/if_rsu.c index 72f4b0b6945..e995b39ec01 100644 --- a/sys/dev/usb/if_rsu.c +++ b/sys/dev/usb/if_rsu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rsu.c,v 1.26 2015/03/14 03:38:49 jsg Exp $ */ +/* $OpenBSD: if_rsu.c,v 1.27 2015/06/12 15:47:31 mpi Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -197,11 +197,11 @@ rsu_match(struct device *parent, void *match, void *aux) { struct usb_attach_arg *uaa = aux; - if (uaa->iface != NULL) + if (uaa->iface == NULL || uaa->configno != 1) return (UMATCH_NONE); return ((usb_lookup(rsu_devs, uaa->vendor, uaa->product) != NULL) ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + UMATCH_VENDOR_PRODUCT_CONF_IFACE : UMATCH_NONE); } void @@ -214,24 +214,11 @@ rsu_attach(struct device *parent, struct device *self, void *aux) int i, error; sc->sc_udev = uaa->device; + sc->sc_iface = uaa->iface; usb_init_task(&sc->sc_task, rsu_task, sc, USB_TASK_TYPE_GENERIC); timeout_set(&sc->calib_to, rsu_calib_to, sc); - if (usbd_set_config_no(sc->sc_udev, 1, 0) != 0) { - printf("%s: could not set configuration no\n", - sc->sc_dev.dv_xname); - return; - } - - /* Get the first interface handle. */ - error = usbd_device2interface_handle(sc->sc_udev, 0, &sc->sc_iface); - if (error != 0) { - printf("%s: could not get interface handle\n", - sc->sc_dev.dv_xname); - return; - } - /* Read chip revision. */ sc->cut = MS(rsu_read_4(sc, R92S_PMC_FSM), R92S_PMC_FSM_CUT); if (sc->cut != 3) |