Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303582
b: refs/heads/master
c: 4571410
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Apr 20, 2012
1 parent e6b4954 commit 659b89d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2b1ff7104d86e1e3cc0ab02f6aa0d96aeb2cf86
refs/heads/master: 45714104b9e85ffa199c5622e227657e99d92fb5
40 changes: 23 additions & 17 deletions trunk/drivers/usb/misc/yurex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -139,16 +140,18 @@ static void yurex_interrupt(struct urb *urb)
case 0: /*success*/
break;
case -EOVERFLOW:
err("%s - overflow with length %d, actual length is %d",
__func__, YUREX_BUF_SIZE, dev->urb->actual_length);
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:
case -ESHUTDOWN:
case -EILSEQ:
/* 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;
}

Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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);
Expand All @@ -221,15 +224,15 @@ 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;
}


/* 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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -269,15 +272,15 @@ 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;
}

/* allocate buffer for interrupt in */
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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}
Expand Down Expand Up @@ -372,8 +376,8 @@ 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",
__func__, subminor);
printk(KERN_ERR "%s - error, can't find device for minor %d",
__func__, subminor);
retval = -ENODEV;
goto exit;
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 659b89d

Please sign in to comment.