diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index 66dfa62187a9..d206340a768e 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -473,8 +473,7 @@ usb2_fifo_create(struct usb2_cdev_privdata *cpd) /* Check TX FIFO */ if (is_tx && (udev->fifo[n + USB_FIFO_TX] == NULL)) { - pipe = usb2_dev_get_pipe(udev, - ep, USB_FIFO_TX); + pipe = usb2_dev_get_pipe(udev, ep, USB_FIFO_TX); DPRINTFN(5, "dev_get_pipe(%d, 0x%x)\n", ep, USB_FIFO_TX); if (pipe == NULL) { DPRINTFN(5, "dev_get_pipe returned NULL\n"); @@ -501,8 +500,7 @@ usb2_fifo_create(struct usb2_cdev_privdata *cpd) if (is_rx && (udev->fifo[n + USB_FIFO_RX] == NULL)) { - pipe = usb2_dev_get_pipe(udev, - ep, USB_FIFO_RX); + pipe = usb2_dev_get_pipe(udev, ep, USB_FIFO_RX); DPRINTFN(5, "dev_get_pipe(%d, 0x%x)\n", ep, USB_FIFO_RX); if (pipe == NULL) { DPRINTFN(5, "dev_get_pipe returned NULL\n"); @@ -598,8 +596,7 @@ usb2_fifo_free(struct usb2_fifo *f) } static struct usb2_pipe * -usb2_dev_get_pipe(struct usb2_device *udev, - uint8_t ep_index, uint8_t dir) +usb2_dev_get_pipe(struct usb2_device *udev, uint8_t ep_index, uint8_t dir) { struct usb2_pipe *pipe; uint8_t ep_dir; diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index f10a23d90be7..f731d515a9ed 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1722,8 +1722,7 @@ usb2_make_dev(struct usb2_device *udev, int ep, int mode) /* Now, create the device itself */ snprintf(devname, sizeof(devname), "%u.%u.%u", - pd->bus_index, pd->dev_index, - pd->ep_addr); + pd->bus_index, pd->dev_index, pd->ep_addr); pd->cdev = make_dev(&usb2_devsw, 0, UID_ROOT, GID_OPERATOR, 0600, USB_DEVICE_DIR "/%s", devname); pd->cdev->si_drv1 = pd; @@ -1734,7 +1733,7 @@ usb2_make_dev(struct usb2_device *udev, int ep, int mode) static void usb2_cdev_create(struct usb2_device *udev) { - struct usb2_config_descriptor *cd = usb2_get_config_descriptor(udev); + struct usb2_config_descriptor *cd; struct usb2_endpoint_descriptor *ed; struct usb2_descriptor *desc; struct usb2_fs_privdata* pd; @@ -1762,6 +1761,7 @@ usb2_cdev_create(struct usb2_device *udev) * Collect all used endpoint numbers instead of just * generating 16 static endpoints. */ + cd = usb2_get_config_descriptor(udev); while ((desc = usb2_desc_foreach(cd, desc))) { /* filter out all endpoint descriptors */ if ((desc->bDescriptorType == UDESC_ENDPOINT) &&