Commit 45714104 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: yurex.c: remove err() usage

err() was a very old USB-specific macro that I thought had
gone away.  This patch removes it from being used in the
driver and uses dev_err() instead.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d2b1ff71
...@@ -83,7 +83,8 @@ static void yurex_control_callback(struct urb *urb) ...@@ -83,7 +83,8 @@ static void yurex_control_callback(struct urb *urb)
int status = urb->status; int status = urb->status;
if (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); wake_up_interruptible(&dev->waitq);
return; return;
} }
...@@ -139,7 +140,8 @@ static void yurex_interrupt(struct urb *urb) ...@@ -139,7 +140,8 @@ static void yurex_interrupt(struct urb *urb)
case 0: /*success*/ case 0: /*success*/
break; break;
case -EOVERFLOW: 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); __func__, YUREX_BUF_SIZE, dev->urb->actual_length);
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
...@@ -148,7 +150,8 @@ static void yurex_interrupt(struct urb *urb) ...@@ -148,7 +150,8 @@ static void yurex_interrupt(struct urb *urb)
/* The device is terminated, clean up */ /* The device is terminated, clean up */
return; return;
default: default:
err("%s - unknown status received: %d", __func__, status); dev_err(&dev->interface->dev,
"%s - unknown status received: %d\n", __func__, status);
goto exit; goto exit;
} }
...@@ -181,7 +184,7 @@ static void yurex_interrupt(struct urb *urb) ...@@ -181,7 +184,7 @@ static void yurex_interrupt(struct urb *urb)
exit: exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC); retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval) { if (retval) {
err("%s - usb_submit_urb failed: %d", dev_err(&dev->interface->dev, "%s - usb_submit_urb failed: %d\n",
__func__, retval); __func__, retval);
} }
} }
...@@ -198,7 +201,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -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 */ /* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) { if (!dev) {
err("Out of memory"); dev_err(&interface->dev, "Out of memory\n");
goto error; goto error;
} }
kref_init(&dev->kref); kref_init(&dev->kref);
...@@ -221,7 +224,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -221,7 +224,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
} }
if (!dev->int_in_endpointAddr) { if (!dev->int_in_endpointAddr) {
retval = -ENODEV; retval = -ENODEV;
err("Could not find endpoints"); dev_err(&interface->dev, "Could not find endpoints\n");
goto error; goto error;
} }
...@@ -229,7 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -229,7 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
/* allocate control URB */ /* allocate control URB */
dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL); dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!dev->cntl_urb) { if (!dev->cntl_urb) {
err("Could not allocate control URB"); dev_err(&interface->dev, "Could not allocate control URB\n");
goto error; goto error;
} }
...@@ -238,7 +241,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -238,7 +241,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
GFP_KERNEL, GFP_KERNEL,
&dev->cntl_urb->setup_dma); &dev->cntl_urb->setup_dma);
if (!dev->cntl_req) { if (!dev->cntl_req) {
err("Could not allocate cntl_req"); dev_err(&interface->dev, "Could not allocate cntl_req\n");
goto error; goto error;
} }
...@@ -247,7 +250,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -247,7 +250,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
GFP_KERNEL, GFP_KERNEL,
&dev->cntl_urb->transfer_dma); &dev->cntl_urb->transfer_dma);
if (!dev->cntl_buffer) { if (!dev->cntl_buffer) {
err("Could not allocate cntl_buffer"); dev_err(&interface->dev, "Could not allocate cntl_buffer\n");
goto error; goto error;
} }
...@@ -269,7 +272,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -269,7 +272,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
/* allocate interrupt URB */ /* allocate interrupt URB */
dev->urb = usb_alloc_urb(0, GFP_KERNEL); dev->urb = usb_alloc_urb(0, GFP_KERNEL);
if (!dev->urb) { if (!dev->urb) {
err("Could not allocate URB"); dev_err(&interface->dev, "Could not allocate URB\n");
goto error; goto error;
} }
...@@ -277,7 +280,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -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, dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
GFP_KERNEL, &dev->urb->transfer_dma); GFP_KERNEL, &dev->urb->transfer_dma);
if (!dev->int_buffer) { if (!dev->int_buffer) {
err("Could not allocate int_buffer"); dev_err(&interface->dev, "Could not allocate int_buffer\n");
goto error; goto error;
} }
...@@ -289,7 +292,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -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; dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
if (usb_submit_urb(dev->urb, GFP_KERNEL)) { if (usb_submit_urb(dev->urb, GFP_KERNEL)) {
retval = -EIO; retval = -EIO;
err("Could not submitting URB"); dev_err(&interface->dev, "Could not submitting URB\n");
goto error; goto error;
} }
...@@ -299,7 +302,8 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ ...@@ -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 */ /* we can register the device now, as it is ready */
retval = usb_register_dev(interface, &yurex_class); retval = usb_register_dev(interface, &yurex_class);
if (retval) { 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); usb_set_intfdata(interface, NULL);
goto error; goto error;
} }
...@@ -372,7 +376,7 @@ static int yurex_open(struct inode *inode, struct file *file) ...@@ -372,7 +376,7 @@ static int yurex_open(struct inode *inode, struct file *file)
interface = usb_find_interface(&yurex_driver, subminor); interface = usb_find_interface(&yurex_driver, subminor);
if (!interface) { 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); __func__, subminor);
retval = -ENODEV; retval = -ENODEV;
goto exit; goto exit;
...@@ -518,7 +522,9 @@ static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t co ...@@ -518,7 +522,9 @@ static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t co
mutex_unlock(&dev->io_mutex); mutex_unlock(&dev->io_mutex);
if (retval < 0) { 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; goto error;
} }
if (set && timeout) if (set && timeout)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment