Commit 9908a32e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: remove err() macro from usb class drivers

USB should not be having it's own printk macros, so remove err() and
use the system-wide standard of dev_err() wherever possible.  In the
few places that will not work out, use a basic printk().
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 194343d9
...@@ -326,8 +326,8 @@ static void acm_ctrl_irq(struct urb *urb) ...@@ -326,8 +326,8 @@ static void acm_ctrl_irq(struct urb *urb)
usb_mark_last_busy(acm->dev); usb_mark_last_busy(acm->dev);
retval = usb_submit_urb (urb, GFP_ATOMIC); retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval) if (retval)
err ("%s - usb_submit_urb failed with result %d", dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with "
__func__, retval); "result %d", __func__, retval);
} }
/* data interface returns incoming bytes, or we got unthrottled */ /* data interface returns incoming bytes, or we got unthrottled */
...@@ -514,7 +514,7 @@ static void acm_waker(struct work_struct *waker) ...@@ -514,7 +514,7 @@ static void acm_waker(struct work_struct *waker)
rv = usb_autopm_get_interface(acm->control); rv = usb_autopm_get_interface(acm->control);
if (rv < 0) { if (rv < 0) {
err("Autopm failure in %s", __func__); dev_err(&acm->dev->dev, "Autopm failure in %s\n", __func__);
return; return;
} }
if (acm->delayed_wb) { if (acm->delayed_wb) {
...@@ -924,7 +924,7 @@ static int acm_probe (struct usb_interface *intf, ...@@ -924,7 +924,7 @@ static int acm_probe (struct usb_interface *intf,
/* normal probing*/ /* normal probing*/
if (!buffer) { if (!buffer) {
err("Weird descriptor references\n"); dev_err(&intf->dev, "Weird descriptor references\n");
return -EINVAL; return -EINVAL;
} }
...@@ -934,21 +934,24 @@ static int acm_probe (struct usb_interface *intf, ...@@ -934,21 +934,24 @@ static int acm_probe (struct usb_interface *intf,
buflen = intf->cur_altsetting->endpoint->extralen; buflen = intf->cur_altsetting->endpoint->extralen;
buffer = intf->cur_altsetting->endpoint->extra; buffer = intf->cur_altsetting->endpoint->extra;
} else { } else {
err("Zero length descriptor references\n"); dev_err(&intf->dev,
"Zero length descriptor references\n");
return -EINVAL; return -EINVAL;
} }
} }
while (buflen > 0) { while (buflen > 0) {
if (buffer [1] != USB_DT_CS_INTERFACE) { if (buffer [1] != USB_DT_CS_INTERFACE) {
err("skipping garbage\n"); dev_err(&intf->dev, "skipping garbage\n");
goto next_desc; goto next_desc;
} }
switch (buffer [2]) { switch (buffer [2]) {
case USB_CDC_UNION_TYPE: /* we've found it */ case USB_CDC_UNION_TYPE: /* we've found it */
if (union_header) { if (union_header) {
err("More than one union descriptor, skipping ..."); dev_err(&intf->dev, "More than one "
"union descriptor, "
"skipping ...\n");
goto next_desc; goto next_desc;
} }
union_header = (struct usb_cdc_union_desc *) union_header = (struct usb_cdc_union_desc *)
...@@ -966,7 +969,9 @@ static int acm_probe (struct usb_interface *intf, ...@@ -966,7 +969,9 @@ static int acm_probe (struct usb_interface *intf,
call_management_function = buffer[3]; call_management_function = buffer[3];
call_interface_num = buffer[4]; call_interface_num = buffer[4];
if ((call_management_function & 3) != 3) if ((call_management_function & 3) != 3)
err("This device cannot do calls on its own. It is no modem."); dev_err(&intf->dev, "This device "
"cannot do calls on its own. "
"It is no modem.\n");
break; break;
default: default:
/* there are LOTS more CDC descriptors that /* there are LOTS more CDC descriptors that
...@@ -1051,7 +1056,7 @@ static int acm_probe (struct usb_interface *intf, ...@@ -1051,7 +1056,7 @@ static int acm_probe (struct usb_interface *intf,
for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++); for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++);
if (minor == ACM_TTY_MINORS) { if (minor == ACM_TTY_MINORS) {
err("no more free acm devices"); dev_err(&intf->dev, "no more free acm devices\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -132,10 +132,12 @@ static void wdm_in_callback(struct urb *urb) ...@@ -132,10 +132,12 @@ static void wdm_in_callback(struct urb *urb)
"nonzero urb status received: -ESHUTDOWN"); "nonzero urb status received: -ESHUTDOWN");
break; break;
case -EPIPE: case -EPIPE:
err("nonzero urb status received: -EPIPE"); dev_err(&desc->intf->dev,
"nonzero urb status received: -EPIPE\n");
break; break;
default: default:
err("Unexpected error %d", status); dev_err(&desc->intf->dev,
"Unexpected error %d\n", status);
break; break;
} }
} }
...@@ -170,16 +172,18 @@ static void wdm_int_callback(struct urb *urb) ...@@ -170,16 +172,18 @@ static void wdm_int_callback(struct urb *urb)
return; /* unplug */ return; /* unplug */
case -EPIPE: case -EPIPE:
set_bit(WDM_INT_STALL, &desc->flags); set_bit(WDM_INT_STALL, &desc->flags);
err("Stall on int endpoint"); dev_err(&desc->intf->dev, "Stall on int endpoint\n");
goto sw; /* halt is cleared in work */ goto sw; /* halt is cleared in work */
default: default:
err("nonzero urb status received: %d", status); dev_err(&desc->intf->dev,
"nonzero urb status received: %d\n", status);
break; break;
} }
} }
if (urb->actual_length < sizeof(struct usb_cdc_notification)) { if (urb->actual_length < sizeof(struct usb_cdc_notification)) {
err("wdm_int_callback - %d bytes", urb->actual_length); dev_err(&desc->intf->dev, "wdm_int_callback - %d bytes\n",
urb->actual_length);
goto exit; goto exit;
} }
...@@ -198,7 +202,8 @@ static void wdm_int_callback(struct urb *urb) ...@@ -198,7 +202,8 @@ static void wdm_int_callback(struct urb *urb)
goto exit; goto exit;
default: default:
clear_bit(WDM_POLL_RUNNING, &desc->flags); clear_bit(WDM_POLL_RUNNING, &desc->flags);
err("unknown notification %d received: index %d len %d", dev_err(&desc->intf->dev,
"unknown notification %d received: index %d len %d\n",
dr->bNotificationType, dr->wIndex, dr->wLength); dr->bNotificationType, dr->wIndex, dr->wLength);
goto exit; goto exit;
} }
...@@ -236,14 +241,16 @@ static void wdm_int_callback(struct urb *urb) ...@@ -236,14 +241,16 @@ static void wdm_int_callback(struct urb *urb)
sw: sw:
rv = schedule_work(&desc->rxwork); rv = schedule_work(&desc->rxwork);
if (rv) if (rv)
err("Cannot schedule work"); dev_err(&desc->intf->dev,
"Cannot schedule work\n");
} }
} }
exit: exit:
rv = usb_submit_urb(urb, GFP_ATOMIC); rv = usb_submit_urb(urb, GFP_ATOMIC);
if (rv) if (rv)
err("%s - usb_submit_urb failed with result %d", dev_err(&desc->intf->dev,
__func__, rv); "%s - usb_submit_urb failed with result %d\n",
__func__, rv);
} }
...@@ -353,7 +360,7 @@ static ssize_t wdm_write ...@@ -353,7 +360,7 @@ static ssize_t wdm_write
if (rv < 0) { if (rv < 0) {
kfree(buf); kfree(buf);
clear_bit(WDM_IN_USE, &desc->flags); clear_bit(WDM_IN_USE, &desc->flags);
err("Tx URB error: %d", rv); dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv);
} else { } else {
dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d",
req->wIndex); req->wIndex);
...@@ -401,7 +408,8 @@ static ssize_t wdm_read ...@@ -401,7 +408,8 @@ static ssize_t wdm_read
int t = desc->rerr; int t = desc->rerr;
desc->rerr = 0; desc->rerr = 0;
spin_unlock_irq(&desc->iuspin); spin_unlock_irq(&desc->iuspin);
err("reading had resulted in %d", t); dev_err(&desc->intf->dev,
"reading had resulted in %d\n", t);
rv = -EIO; rv = -EIO;
goto err; goto err;
} }
...@@ -440,7 +448,7 @@ static ssize_t wdm_read ...@@ -440,7 +448,7 @@ static ssize_t wdm_read
err: err:
mutex_unlock(&desc->rlock); mutex_unlock(&desc->rlock);
if (rv < 0) if (rv < 0)
err("wdm_read: exit error"); dev_err(&desc->intf->dev, "wdm_read: exit error\n");
return rv; return rv;
} }
...@@ -450,7 +458,8 @@ static int wdm_flush(struct file *file, fl_owner_t id) ...@@ -450,7 +458,8 @@ static int wdm_flush(struct file *file, fl_owner_t id)
wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags)); wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags));
if (desc->werr < 0) if (desc->werr < 0)
err("Error in flush path: %d", desc->werr); dev_err(&desc->intf->dev, "Error in flush path: %d\n",
desc->werr);
return desc->werr; return desc->werr;
} }
...@@ -502,7 +511,7 @@ static int wdm_open(struct inode *inode, struct file *file) ...@@ -502,7 +511,7 @@ static int wdm_open(struct inode *inode, struct file *file)
rv = usb_autopm_get_interface(desc->intf); rv = usb_autopm_get_interface(desc->intf);
if (rv < 0) { if (rv < 0) {
err("Error autopm - %d", rv); dev_err(&desc->intf->dev, "Error autopm - %d\n", rv);
goto out; goto out;
} }
intf->needs_remote_wakeup = 1; intf->needs_remote_wakeup = 1;
...@@ -512,7 +521,8 @@ static int wdm_open(struct inode *inode, struct file *file) ...@@ -512,7 +521,8 @@ static int wdm_open(struct inode *inode, struct file *file)
rv = usb_submit_urb(desc->validity, GFP_KERNEL); rv = usb_submit_urb(desc->validity, GFP_KERNEL);
if (rv < 0) { if (rv < 0) {
desc->count--; desc->count--;
err("Error submitting int urb - %d", rv); dev_err(&desc->intf->dev,
"Error submitting int urb - %d\n", rv);
} }
} else { } else {
rv = 0; rv = 0;
...@@ -600,7 +610,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -600,7 +610,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
while (buflen > 0) { while (buflen > 0) {
if (buffer [1] != USB_DT_CS_INTERFACE) { if (buffer [1] != USB_DT_CS_INTERFACE) {
err("skipping garbage"); dev_err(&intf->dev, "skipping garbage\n");
goto next_desc; goto next_desc;
} }
...@@ -614,7 +624,8 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -614,7 +624,8 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id)
"Finding maximum buffer length: %d", maxcom); "Finding maximum buffer length: %d", maxcom);
break; break;
default: default:
err("Ignoring extra header, type %d, length %d", dev_err(&intf->dev,
"Ignoring extra header, type %d, length %d\n",
buffer[2], buffer[0]); buffer[2], buffer[0]);
break; break;
} }
...@@ -772,7 +783,8 @@ static int recover_from_urb_loss(struct wdm_device *desc) ...@@ -772,7 +783,8 @@ static int recover_from_urb_loss(struct wdm_device *desc)
if (desc->count) { if (desc->count) {
rv = usb_submit_urb(desc->validity, GFP_NOIO); rv = usb_submit_urb(desc->validity, GFP_NOIO);
if (rv < 0) if (rv < 0)
err("Error resume submitting int urb - %d", rv); dev_err(&desc->intf->dev,
"Error resume submitting int urb - %d\n", rv);
} }
return rv; return rv;
} }
......
...@@ -593,8 +593,9 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -593,8 +593,9 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
err = usblp_hp_channel_change_request(usblp, err = usblp_hp_channel_change_request(usblp,
arg, &newChannel); arg, &newChannel);
if (err < 0) { if (err < 0) {
err("usblp%d: error = %d setting " dev_err(&usblp->dev->dev,
"HP channel", "usblp%d: error = %d setting "
"HP channel\n",
usblp->minor, err); usblp->minor, err);
retval = -EIO; retval = -EIO;
goto done; goto done;
...@@ -1345,7 +1346,7 @@ static void usblp_disconnect(struct usb_interface *intf) ...@@ -1345,7 +1346,7 @@ static void usblp_disconnect(struct usb_interface *intf)
usb_deregister_dev(intf, &usblp_class); usb_deregister_dev(intf, &usblp_class);
if (!usblp || !usblp->dev) { if (!usblp || !usblp->dev) {
err("bogus disconnect"); dev_err(&intf->dev, "bogus disconnect\n");
BUG (); BUG ();
} }
......
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