From 9908a32e94de2141463e104c9924279ed3509447 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 14 Aug 2008 09:37:34 -0700 Subject: [PATCH] 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: Greg Kroah-Hartman --- drivers/usb/class/cdc-acm.c | 23 +++++++++++------- drivers/usb/class/cdc-wdm.c | 48 +++++++++++++++++++++++-------------- drivers/usb/class/usblp.c | 7 +++--- 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index d9c2b8dafd67..fab23ee8702b 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -326,8 +326,8 @@ exit: usb_mark_last_busy(acm->dev); retval = usb_submit_urb (urb, GFP_ATOMIC); if (retval) - err ("%s - usb_submit_urb failed with result %d", - __func__, retval); + dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with " + "result %d", __func__, retval); } /* data interface returns incoming bytes, or we got unthrottled */ @@ -514,7 +514,7 @@ static void acm_waker(struct work_struct *waker) rv = usb_autopm_get_interface(acm->control); if (rv < 0) { - err("Autopm failure in %s", __func__); + dev_err(&acm->dev->dev, "Autopm failure in %s\n", __func__); return; } if (acm->delayed_wb) { @@ -924,7 +924,7 @@ static int acm_probe (struct usb_interface *intf, /* normal probing*/ if (!buffer) { - err("Weird descriptor references\n"); + dev_err(&intf->dev, "Weird descriptor references\n"); return -EINVAL; } @@ -934,21 +934,24 @@ static int acm_probe (struct usb_interface *intf, buflen = intf->cur_altsetting->endpoint->extralen; buffer = intf->cur_altsetting->endpoint->extra; } else { - err("Zero length descriptor references\n"); + dev_err(&intf->dev, + "Zero length descriptor references\n"); return -EINVAL; } } while (buflen > 0) { if (buffer [1] != USB_DT_CS_INTERFACE) { - err("skipping garbage\n"); + dev_err(&intf->dev, "skipping garbage\n"); goto next_desc; } switch (buffer [2]) { case USB_CDC_UNION_TYPE: /* we've found it */ if (union_header) { - err("More than one union descriptor, skipping ..."); + dev_err(&intf->dev, "More than one " + "union descriptor, " + "skipping ...\n"); goto next_desc; } union_header = (struct usb_cdc_union_desc *) @@ -966,7 +969,9 @@ static int acm_probe (struct usb_interface *intf, call_management_function = buffer[3]; call_interface_num = buffer[4]; 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; default: /* there are LOTS more CDC descriptors that @@ -1051,7 +1056,7 @@ skip_normal_probe: for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++); if (minor == ACM_TTY_MINORS) { - err("no more free acm devices"); + dev_err(&intf->dev, "no more free acm devices\n"); return -ENODEV; } diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 7e8e1235e4e5..7429f70b9d06 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -132,10 +132,12 @@ static void wdm_in_callback(struct urb *urb) "nonzero urb status received: -ESHUTDOWN"); break; case -EPIPE: - err("nonzero urb status received: -EPIPE"); + dev_err(&desc->intf->dev, + "nonzero urb status received: -EPIPE\n"); break; default: - err("Unexpected error %d", status); + dev_err(&desc->intf->dev, + "Unexpected error %d\n", status); break; } } @@ -170,16 +172,18 @@ static void wdm_int_callback(struct urb *urb) return; /* unplug */ case -EPIPE: 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 */ default: - err("nonzero urb status received: %d", status); + dev_err(&desc->intf->dev, + "nonzero urb status received: %d\n", status); break; } } 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; } @@ -198,7 +202,8 @@ static void wdm_int_callback(struct urb *urb) goto exit; default: 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); goto exit; } @@ -236,14 +241,16 @@ static void wdm_int_callback(struct urb *urb) sw: rv = schedule_work(&desc->rxwork); if (rv) - err("Cannot schedule work"); + dev_err(&desc->intf->dev, + "Cannot schedule work\n"); } } exit: rv = usb_submit_urb(urb, GFP_ATOMIC); if (rv) - err("%s - usb_submit_urb failed with result %d", - __func__, rv); + dev_err(&desc->intf->dev, + "%s - usb_submit_urb failed with result %d\n", + __func__, rv); } @@ -353,7 +360,7 @@ static ssize_t wdm_write if (rv < 0) { kfree(buf); 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 { dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", req->wIndex); @@ -401,7 +408,8 @@ retry: int t = desc->rerr; desc->rerr = 0; 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; goto err; } @@ -440,7 +448,7 @@ retry: err: mutex_unlock(&desc->rlock); if (rv < 0) - err("wdm_read: exit error"); + dev_err(&desc->intf->dev, "wdm_read: exit error\n"); return rv; } @@ -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)); 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; } @@ -502,7 +511,7 @@ static int wdm_open(struct inode *inode, struct file *file) rv = usb_autopm_get_interface(desc->intf); if (rv < 0) { - err("Error autopm - %d", rv); + dev_err(&desc->intf->dev, "Error autopm - %d\n", rv); goto out; } intf->needs_remote_wakeup = 1; @@ -512,7 +521,8 @@ static int wdm_open(struct inode *inode, struct file *file) rv = usb_submit_urb(desc->validity, GFP_KERNEL); if (rv < 0) { desc->count--; - err("Error submitting int urb - %d", rv); + dev_err(&desc->intf->dev, + "Error submitting int urb - %d\n", rv); } } else { rv = 0; @@ -600,7 +610,7 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id) while (buflen > 0) { if (buffer [1] != USB_DT_CS_INTERFACE) { - err("skipping garbage"); + dev_err(&intf->dev, "skipping garbage\n"); goto next_desc; } @@ -614,7 +624,8 @@ static int wdm_probe(struct usb_interface *intf, const struct usb_device_id *id) "Finding maximum buffer length: %d", maxcom); break; 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]); break; } @@ -772,7 +783,8 @@ static int recover_from_urb_loss(struct wdm_device *desc) if (desc->count) { rv = usb_submit_urb(desc->validity, GFP_NOIO); 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; } diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 68a2239cd0b6..b5775af3ba26 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -593,8 +593,9 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) err = usblp_hp_channel_change_request(usblp, arg, &newChannel); if (err < 0) { - err("usblp%d: error = %d setting " - "HP channel", + dev_err(&usblp->dev->dev, + "usblp%d: error = %d setting " + "HP channel\n", usblp->minor, err); retval = -EIO; goto done; @@ -1345,7 +1346,7 @@ static void usblp_disconnect(struct usb_interface *intf) usb_deregister_dev(intf, &usblp_class); if (!usblp || !usblp->dev) { - err("bogus disconnect"); + dev_err(&intf->dev, "bogus disconnect\n"); BUG (); } -- 2.20.1