aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/ums.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2007-06-12 15:37:19 +0000
committerWarner Losh <imp@FreeBSD.org>2007-06-12 15:37:19 +0000
commit645016c0e428f5acb73007eb3c79ab0aee92ffa5 (patch)
tree0ae8c91399f156d2d3de7df83e1fc292de48873b /sys/dev/usb/ums.c
parente141ee255d293ca8ec36b2567fd4cdf56443116f (diff)
Expand USB_ATTACH_{ERROR,SUCCESS}_RETURN inline and eliminate from
usb_port.h. They aren't needed, and are a legacy of this code's past.
Notes
Notes: svn path=/head/; revision=170612
Diffstat (limited to 'sys/dev/usb/ums.c')
-rw-r--r--sys/dev/usb/ums.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
index ab2d36f82bcb..fad6c54f16ae 100644
--- a/sys/dev/usb/ums.c
+++ b/sys/dev/usb/ums.c
@@ -208,7 +208,7 @@ USB_ATTACH(ums)
if (!ed) {
printf("%s: could not read endpoint descriptor\n",
device_get_nameunit(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
}
DPRINTFN(10,("ums_attach: bLength=%d bDescriptorType=%d "
@@ -224,33 +224,33 @@ USB_ATTACH(ums)
UE_GET_XFERTYPE(ed->bmAttributes) != UE_INTERRUPT) {
printf("%s: unexpected endpoint\n",
device_get_nameunit(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
}
err = usbd_read_report_desc(uaa->iface, &desc, &size, M_TEMP);
if (err)
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
hid_input, &sc->sc_loc_x, &flags)) {
printf("%s: mouse has no X report\n", device_get_nameunit(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
}
if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
printf("%s: X report 0x%04x not supported\n",
device_get_nameunit(sc->sc_dev), flags);
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
}
if (!hid_locate(desc, size, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
hid_input, &sc->sc_loc_y, &flags)) {
printf("%s: mouse has no Y report\n", device_get_nameunit(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
}
if ((flags & MOUSE_FLAGS_MASK) != MOUSE_FLAGS) {
printf("%s: Y report 0x%04x not supported\n",
device_get_nameunit(sc->sc_dev), flags);
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
}
/* try to guess the Z activator: first check Z, then WHEEL */
@@ -288,7 +288,7 @@ USB_ATTACH(ums)
M_USBDEV, M_NOWAIT);
if (!sc->sc_loc_btn) {
printf("%s: no memory\n", device_get_nameunit(sc->sc_dev));
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
}
printf("%s: %d buttons%s%s.\n", device_get_nameunit(sc->sc_dev),
@@ -304,7 +304,7 @@ USB_ATTACH(ums)
if (!sc->sc_ibuf) {
printf("%s: no memory\n", device_get_nameunit(sc->sc_dev));
free(sc->sc_loc_btn, M_USB);
- USB_ATTACH_ERROR_RETURN;
+ return ENXIO;
}
sc->sc_ep_addr = ed->bEndpointAddress;
@@ -364,7 +364,7 @@ USB_ATTACH(ums)
sc->flags |= UMS_SPUR_BUT_UP;
}
- USB_ATTACH_SUCCESS_RETURN;
+ return 0;
}