Loading drivers/usb/misc/yurex.c +23 −17 Original line number Diff line number Diff line Loading @@ -83,7 +83,8 @@ static void yurex_control_callback(struct urb *urb) int status = urb->status; if (status) { err("%s - control failed: %d\n", __func__, status); dev_err(&urb->dev->dev, "%s - control failed: %d\n", __func__, status); wake_up_interruptible(&dev->waitq); return; } Loading Loading @@ -139,7 +140,8 @@ static void yurex_interrupt(struct urb *urb) case 0: /*success*/ break; case -EOVERFLOW: err("%s - overflow with length %d, actual length is %d", dev_err(&dev->interface->dev, "%s - overflow with length %d, actual length is %d\n", __func__, YUREX_BUF_SIZE, dev->urb->actual_length); case -ECONNRESET: case -ENOENT: Loading @@ -148,7 +150,8 @@ static void yurex_interrupt(struct urb *urb) /* The device is terminated, clean up */ return; default: err("%s - unknown status received: %d", __func__, status); dev_err(&dev->interface->dev, "%s - unknown status received: %d\n", __func__, status); goto exit; } Loading Loading @@ -181,7 +184,7 @@ static void yurex_interrupt(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) { err("%s - usb_submit_urb failed: %d", dev_err(&dev->interface->dev, "%s - usb_submit_urb failed: %d\n", __func__, retval); } } Loading @@ -198,7 +201,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate memory for our device state and initialize it */ dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) { err("Out of memory"); dev_err(&interface->dev, "Out of memory\n"); goto error; } kref_init(&dev->kref); Loading @@ -221,7 +224,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ } if (!dev->int_in_endpointAddr) { retval = -ENODEV; err("Could not find endpoints"); dev_err(&interface->dev, "Could not find endpoints\n"); goto error; } Loading @@ -229,7 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate control URB */ dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL); if (!dev->cntl_urb) { err("Could not allocate control URB"); dev_err(&interface->dev, "Could not allocate control URB\n"); goto error; } Loading @@ -238,7 +241,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ GFP_KERNEL, &dev->cntl_urb->setup_dma); if (!dev->cntl_req) { err("Could not allocate cntl_req"); dev_err(&interface->dev, "Could not allocate cntl_req\n"); goto error; } Loading @@ -247,7 +250,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ GFP_KERNEL, &dev->cntl_urb->transfer_dma); if (!dev->cntl_buffer) { err("Could not allocate cntl_buffer"); dev_err(&interface->dev, "Could not allocate cntl_buffer\n"); goto error; } Loading @@ -269,7 +272,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate interrupt URB */ dev->urb = usb_alloc_urb(0, GFP_KERNEL); if (!dev->urb) { err("Could not allocate URB"); dev_err(&interface->dev, "Could not allocate URB\n"); goto error; } Loading @@ -277,7 +280,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, GFP_KERNEL, &dev->urb->transfer_dma); if (!dev->int_buffer) { err("Could not allocate int_buffer"); dev_err(&interface->dev, "Could not allocate int_buffer\n"); goto error; } Loading @@ -289,7 +292,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; if (usb_submit_urb(dev->urb, GFP_KERNEL)) { retval = -EIO; err("Could not submitting URB"); dev_err(&interface->dev, "Could not submitting URB\n"); goto error; } Loading @@ -299,7 +302,8 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* we can register the device now, as it is ready */ retval = usb_register_dev(interface, &yurex_class); if (retval) { err("Not able to get a minor for this device."); dev_err(&interface->dev, "Not able to get a minor for this device.\n"); usb_set_intfdata(interface, NULL); goto error; } Loading Loading @@ -372,7 +376,7 @@ static int yurex_open(struct inode *inode, struct file *file) interface = usb_find_interface(&yurex_driver, subminor); if (!interface) { err("%s - error, can't find device for minor %d", printk(KERN_ERR "%s - error, can't find device for minor %d", __func__, subminor); retval = -ENODEV; goto exit; Loading Loading @@ -518,7 +522,9 @@ static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t co mutex_unlock(&dev->io_mutex); if (retval < 0) { err("%s - failed to send bulk msg, error %d", __func__, retval); dev_err(&dev->interface->dev, "%s - failed to send bulk msg, error %d\n", __func__, retval); goto error; } if (set && timeout) Loading Loading
drivers/usb/misc/yurex.c +23 −17 Original line number Diff line number Diff line Loading @@ -83,7 +83,8 @@ static void yurex_control_callback(struct urb *urb) int status = urb->status; if (status) { err("%s - control failed: %d\n", __func__, status); dev_err(&urb->dev->dev, "%s - control failed: %d\n", __func__, status); wake_up_interruptible(&dev->waitq); return; } Loading Loading @@ -139,7 +140,8 @@ static void yurex_interrupt(struct urb *urb) case 0: /*success*/ break; case -EOVERFLOW: err("%s - overflow with length %d, actual length is %d", dev_err(&dev->interface->dev, "%s - overflow with length %d, actual length is %d\n", __func__, YUREX_BUF_SIZE, dev->urb->actual_length); case -ECONNRESET: case -ENOENT: Loading @@ -148,7 +150,8 @@ static void yurex_interrupt(struct urb *urb) /* The device is terminated, clean up */ return; default: err("%s - unknown status received: %d", __func__, status); dev_err(&dev->interface->dev, "%s - unknown status received: %d\n", __func__, status); goto exit; } Loading Loading @@ -181,7 +184,7 @@ static void yurex_interrupt(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) { err("%s - usb_submit_urb failed: %d", dev_err(&dev->interface->dev, "%s - usb_submit_urb failed: %d\n", __func__, retval); } } Loading @@ -198,7 +201,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate memory for our device state and initialize it */ dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) { err("Out of memory"); dev_err(&interface->dev, "Out of memory\n"); goto error; } kref_init(&dev->kref); Loading @@ -221,7 +224,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ } if (!dev->int_in_endpointAddr) { retval = -ENODEV; err("Could not find endpoints"); dev_err(&interface->dev, "Could not find endpoints\n"); goto error; } Loading @@ -229,7 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate control URB */ dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL); if (!dev->cntl_urb) { err("Could not allocate control URB"); dev_err(&interface->dev, "Could not allocate control URB\n"); goto error; } Loading @@ -238,7 +241,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ GFP_KERNEL, &dev->cntl_urb->setup_dma); if (!dev->cntl_req) { err("Could not allocate cntl_req"); dev_err(&interface->dev, "Could not allocate cntl_req\n"); goto error; } Loading @@ -247,7 +250,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ GFP_KERNEL, &dev->cntl_urb->transfer_dma); if (!dev->cntl_buffer) { err("Could not allocate cntl_buffer"); dev_err(&interface->dev, "Could not allocate cntl_buffer\n"); goto error; } Loading @@ -269,7 +272,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate interrupt URB */ dev->urb = usb_alloc_urb(0, GFP_KERNEL); if (!dev->urb) { err("Could not allocate URB"); dev_err(&interface->dev, "Could not allocate URB\n"); goto error; } Loading @@ -277,7 +280,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, GFP_KERNEL, &dev->urb->transfer_dma); if (!dev->int_buffer) { err("Could not allocate int_buffer"); dev_err(&interface->dev, "Could not allocate int_buffer\n"); goto error; } Loading @@ -289,7 +292,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; if (usb_submit_urb(dev->urb, GFP_KERNEL)) { retval = -EIO; err("Could not submitting URB"); dev_err(&interface->dev, "Could not submitting URB\n"); goto error; } Loading @@ -299,7 +302,8 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* we can register the device now, as it is ready */ retval = usb_register_dev(interface, &yurex_class); if (retval) { err("Not able to get a minor for this device."); dev_err(&interface->dev, "Not able to get a minor for this device.\n"); usb_set_intfdata(interface, NULL); goto error; } Loading Loading @@ -372,7 +376,7 @@ static int yurex_open(struct inode *inode, struct file *file) interface = usb_find_interface(&yurex_driver, subminor); if (!interface) { err("%s - error, can't find device for minor %d", printk(KERN_ERR "%s - error, can't find device for minor %d", __func__, subminor); retval = -ENODEV; goto exit; Loading Loading @@ -518,7 +522,9 @@ static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t co mutex_unlock(&dev->io_mutex); if (retval < 0) { err("%s - failed to send bulk msg, error %d", __func__, retval); dev_err(&dev->interface->dev, "%s - failed to send bulk msg, error %d\n", __func__, retval); goto error; } if (set && timeout) Loading