From 8b421aa93895fa0d7217b0be251d8af15bf2c56d Mon Sep 17 00:00:00 2001 From: Elric Fu Date: Wed, 27 Jun 2012 16:30:57 +0800 Subject: [PATCH] --- yaml --- r: 326015 b: refs/heads/master c: c181bc5b5d5c79b71203cd10cef97f802fb6f9c1 h: refs/heads/master i: 326013: 0b84d8cc105f2fb13774544d1ff314cb3fa28a52 326011: ea0844d1f356edb231e86dda66c6830c0b286277 326007: 47f04c2ba3bd224f9fadf169ea938fe6b6f9a437 325999: 3d78e6e82b0a1cf44b9dd2bd1a471025645a31dc 325983: fa10887d376f097b87f1ee361701c84b27c709aa 325951: 02fd5592a231790d4496bd0195c734a149b77f76 325887: dbd92ccf4301e46165bb08cf2a4b8d6831f02b4a v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/xhci-ring.c | 3 + trunk/drivers/usb/host/xhci.c | 6 +- trunk/drivers/usb/host/xhci.h | 4 + trunk/drivers/usb/serial/console.c | 17 +-- trunk/drivers/usb/serial/usb-serial.c | 152 ++++++++++++++------------ 6 files changed, 104 insertions(+), 80 deletions(-) diff --git a/[refs] b/[refs] index 371c185fce8f..d6557551fbe4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 92931d243b5cafa23de2d693342966bb9133cdbc +refs/heads/master: c181bc5b5d5c79b71203cd10cef97f802fb6f9c1 diff --git a/trunk/drivers/usb/host/xhci-ring.c b/trunk/drivers/usb/host/xhci-ring.c index 643c2f3f3e73..75c857ec55b9 100644 --- a/trunk/drivers/usb/host/xhci-ring.c +++ b/trunk/drivers/usb/host/xhci-ring.c @@ -280,6 +280,9 @@ static inline int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring, /* Ring the host controller doorbell after placing a command on the ring */ void xhci_ring_cmd_db(struct xhci_hcd *xhci) { + if (!(xhci->cmd_ring_state & CMD_RING_STATE_RUNNING)) + return; + xhci_dbg(xhci, "// Ding dong!\n"); xhci_writel(xhci, DB_VALUE_HOST, &xhci->dba->doorbell[0]); /* Flush PCI posted writes */ diff --git a/trunk/drivers/usb/host/xhci.c b/trunk/drivers/usb/host/xhci.c index c59d5b5b6c7d..f425356e71f2 100644 --- a/trunk/drivers/usb/host/xhci.c +++ b/trunk/drivers/usb/host/xhci.c @@ -104,9 +104,10 @@ int xhci_halt(struct xhci_hcd *xhci) ret = handshake(xhci, &xhci->op_regs->status, STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC); - if (!ret) + if (!ret) { xhci->xhc_state |= XHCI_STATE_HALTED; - else + xhci->cmd_ring_state = CMD_RING_STATE_STOPPED; + } else xhci_warn(xhci, "Host not halted after %u microseconds.\n", XHCI_MAX_HALT_USEC); return ret; @@ -485,6 +486,7 @@ static int xhci_run_finished(struct xhci_hcd *xhci) return -ENODEV; } xhci->shared_hcd->state = HC_STATE_RUNNING; + xhci->cmd_ring_state = CMD_RING_STATE_RUNNING; if (xhci->quirks & XHCI_NEC_HOST) xhci_ring_cmd_db(xhci); diff --git a/trunk/drivers/usb/host/xhci.h b/trunk/drivers/usb/host/xhci.h index c713256297ac..33f24e9fa766 100644 --- a/trunk/drivers/usb/host/xhci.h +++ b/trunk/drivers/usb/host/xhci.h @@ -1421,6 +1421,10 @@ struct xhci_hcd { /* data structures */ struct xhci_device_context_array *dcbaa; struct xhci_ring *cmd_ring; + unsigned int cmd_ring_state; +#define CMD_RING_STATE_RUNNING (1 << 0) +#define CMD_RING_STATE_ABORTED (1 << 1) +#define CMD_RING_STATE_STOPPED (1 << 2) unsigned int cmd_ring_reserved_trbs; struct xhci_ring *event_ring; struct xhci_erst erst; diff --git a/trunk/drivers/usb/serial/console.c b/trunk/drivers/usb/serial/console.c index 335f98d092cc..b9cca6dcde07 100644 --- a/trunk/drivers/usb/serial/console.c +++ b/trunk/drivers/usb/serial/console.c @@ -11,8 +11,6 @@ * */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #include #include #include @@ -70,6 +68,8 @@ static int usb_console_setup(struct console *co, char *options) struct tty_struct *tty = NULL; struct ktermios dummy; + dbg("%s", __func__); + if (options) { baud = simple_strtoul(options, NULL, 10); s = options; @@ -113,7 +113,8 @@ static int usb_console_setup(struct console *co, char *options) serial = usb_serial_get_by_index(co->index); if (serial == NULL) { /* no device is connected yet, sorry :( */ - pr_err("No USB device connected to ttyUSB%i\n", co->index); + printk(KERN_ERR "No USB device connected to ttyUSB%i\n", + co->index); return -ENODEV; } @@ -212,10 +213,10 @@ static void usb_console_write(struct console *co, if (count == 0) return; - pr_debug("%s - port %d, %d byte(s)\n", __func__, port->number, count); + dbg("%s - port %d, %d byte(s)", __func__, port->number, count); if (!port->port.console) { - pr_debug("%s - port not opened\n", __func__); + dbg("%s - port not opened", __func__); return; } @@ -236,7 +237,7 @@ static void usb_console_write(struct console *co, retval = serial->type->write(NULL, port, buf, i); else retval = usb_serial_generic_write(NULL, port, buf, i); - pr_debug("%s - return value : %d\n", __func__, retval); + dbg("%s - return value : %d", __func__, retval); if (lf) { /* append CR after LF */ unsigned char cr = 13; @@ -246,7 +247,7 @@ static void usb_console_write(struct console *co, else retval = usb_serial_generic_write(NULL, port, &cr, 1); - pr_debug("%s - return value : %d\n", __func__, retval); + dbg("%s - return value : %d", __func__, retval); } buf += i; count -= i; @@ -301,7 +302,7 @@ void usb_serial_console_init(int serial_debug, int minor) * register_console). console_write() is called immediately * from register_console iff CON_PRINTBUFFER is set in flags. */ - pr_debug("registering the USB serial console.\n"); + dbg("registering the USB serial console."); register_console(&usbcons); } } diff --git a/trunk/drivers/usb/serial/usb-serial.c b/trunk/drivers/usb/serial/usb-serial.c index 8a9352b2c26f..27483f91a4a3 100644 --- a/trunk/drivers/usb/serial/usb-serial.c +++ b/trunk/drivers/usb/serial/usb-serial.c @@ -17,8 +17,6 @@ * */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #include #include #include @@ -89,7 +87,7 @@ static struct usb_serial *get_free_serial(struct usb_serial *serial, unsigned int i, j; int good_spot; - dev_dbg(&serial->interface->dev, "%s %d\n", __func__, num_ports); + dbg("%s %d", __func__, num_ports); *minor = 0; mutex_lock(&table_lock); @@ -109,7 +107,7 @@ static struct usb_serial *get_free_serial(struct usb_serial *serial, *minor = i; j = 0; - dev_dbg(&serial->interface->dev, "%s - minor base = %d\n", __func__, *minor); + dbg("%s - minor base = %d", __func__, *minor); for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) { serial_table[i] = serial; serial->port[j++]->number = i; @@ -125,6 +123,8 @@ static void return_serial(struct usb_serial *serial) { int i; + dbg("%s", __func__); + mutex_lock(&table_lock); for (i = 0; i < serial->num_ports; ++i) serial_table[serial->minor + i] = NULL; @@ -139,6 +139,8 @@ static void destroy_serial(struct kref *kref) serial = to_usb_serial(kref); + dbg("%s - %s", __func__, serial->type->description); + /* return the minor range that this device had */ if (serial->minor != SERIAL_TTY_NO_MINOR) return_serial(serial); @@ -189,6 +191,8 @@ static int serial_install(struct tty_driver *driver, struct tty_struct *tty) struct usb_serial_port *port; int retval = -ENODEV; + dbg("%s", __func__); + serial = usb_serial_get_by_index(idx); if (!serial) return retval; @@ -252,7 +256,7 @@ static int serial_open(struct tty_struct *tty, struct file *filp) { struct usb_serial_port *port = tty->driver_data; - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); return tty_port_open(&port->port, tty, filp); } @@ -283,16 +287,14 @@ static void serial_down(struct tty_port *tport) static void serial_hangup(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; - - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); tty_port_hangup(&port->port); } static void serial_close(struct tty_struct *tty, struct file *filp) { struct usb_serial_port *port = tty->driver_data; - - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); tty_port_close(&port->port, tty, filp); } @@ -318,7 +320,7 @@ static void serial_cleanup(struct tty_struct *tty) if (port->port.console) return; - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); tty->driver_data = NULL; @@ -343,8 +345,7 @@ static int serial_write(struct tty_struct *tty, const unsigned char *buf, if (port->serial->dev->state == USB_STATE_NOTATTACHED) goto exit; - dev_dbg(tty->dev, "%s - port %d, %d byte(s)\n", __func__, - port->number, count); + dbg("%s - port %d, %d byte(s)", __func__, port->number, count); /* pass on to the driver specific version of this function */ retval = port->serial->type->write(tty, port, buf, count); @@ -357,8 +358,7 @@ static int serial_write(struct tty_struct *tty, const unsigned char *buf, static int serial_write_room(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; - - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); /* pass on to the driver specific version of this function */ return port->serial->type->write_room(tty); } @@ -366,8 +366,7 @@ static int serial_write_room(struct tty_struct *tty) static int serial_chars_in_buffer(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; - - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); /* if the device was unplugged then any remaining characters fell out of the connector ;) */ @@ -380,8 +379,7 @@ static int serial_chars_in_buffer(struct tty_struct *tty) static void serial_throttle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; - - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); /* pass on to the driver specific version of this function */ if (port->serial->type->throttle) @@ -391,8 +389,7 @@ static void serial_throttle(struct tty_struct *tty) static void serial_unthrottle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; - - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); /* pass on to the driver specific version of this function */ if (port->serial->type->unthrottle) @@ -405,8 +402,7 @@ static int serial_ioctl(struct tty_struct *tty, struct usb_serial_port *port = tty->driver_data; int retval = -ENODEV; - dev_dbg(tty->dev, "%s - port %d, cmd 0x%.4x\n", __func__, - port->number, cmd); + dbg("%s - port %d, cmd 0x%.4x", __func__, port->number, cmd); /* pass on to the driver specific version of this function if it is available */ @@ -420,8 +416,7 @@ static int serial_ioctl(struct tty_struct *tty, static void serial_set_termios(struct tty_struct *tty, struct ktermios *old) { struct usb_serial_port *port = tty->driver_data; - - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); /* pass on to the driver specific version of this function if it is available */ @@ -435,7 +430,7 @@ static int serial_break(struct tty_struct *tty, int break_state) { struct usb_serial_port *port = tty->driver_data; - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); /* pass on to the driver specific version of this function if it is available */ @@ -450,6 +445,7 @@ static int serial_proc_show(struct seq_file *m, void *v) int i; char tmp[40]; + dbg("%s", __func__); seq_puts(m, "usbserinfo:1.0 driver:2.0\n"); for (i = 0; i < SERIAL_TTY_MINORS; ++i) { serial = usb_serial_get_by_index(i); @@ -494,7 +490,7 @@ static int serial_tiocmget(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); if (port->serial->type->tiocmget) return port->serial->type->tiocmget(tty); @@ -506,7 +502,7 @@ static int serial_tiocmset(struct tty_struct *tty, { struct usb_serial_port *port = tty->driver_data; - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); if (port->serial->type->tiocmset) return port->serial->type->tiocmset(tty, set, clear); @@ -518,7 +514,7 @@ static int serial_get_icount(struct tty_struct *tty, { struct usb_serial_port *port = tty->driver_data; - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); + dbg("%s - port %d", __func__, port->number); if (port->serial->type->get_icount) return port->serial->type->get_icount(tty, icount); @@ -542,12 +538,12 @@ static void usb_serial_port_work(struct work_struct *work) container_of(work, struct usb_serial_port, work); struct tty_struct *tty; + dbg("%s - port %d", __func__, port->number); + tty = tty_port_tty_get(&port->port); if (!tty) return; - dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); - tty_wakeup(tty); tty_kref_put(tty); } @@ -580,7 +576,7 @@ static void port_release(struct device *dev) struct usb_serial_port *port = to_usb_serial_port(dev); int i; - dev_dbg(dev, "%s\n", __func__); + dbg ("%s - %s", __func__, dev_name(dev)); /* * Stop all the traffic before cancelling the work, so that @@ -649,12 +645,12 @@ static const struct usb_device_id *get_iface_id(struct usb_serial_driver *drv, id = usb_match_id(intf, drv->id_table); if (id) { - dev_dbg(&intf->dev, "static descriptor matches\n"); + dbg("static descriptor matches"); goto exit; } id = match_dynamic_id(intf, drv); if (id) - dev_dbg(&intf->dev, "dynamic descriptor matches\n"); + dbg("dynamic descriptor matches"); exit: return id; } @@ -708,7 +704,6 @@ static const struct tty_port_operations serial_port_ops = { static int usb_serial_probe(struct usb_interface *interface, const struct usb_device_id *id) { - struct device *ddev = &interface->dev; struct usb_device *dev = interface_to_usbdev(interface); struct usb_serial *serial = NULL; struct usb_serial_port *port; @@ -735,13 +730,13 @@ static int usb_serial_probe(struct usb_interface *interface, type = search_serial_device(interface); if (!type) { mutex_unlock(&table_lock); - dev_dbg(ddev, "none matched\n"); + dbg("none matched"); return -ENODEV; } if (!try_module_get(type->driver.owner)) { mutex_unlock(&table_lock); - dev_err(ddev, "module get failed, exiting\n"); + dev_err(&interface->dev, "module get failed, exiting\n"); return -EIO; } mutex_unlock(&table_lock); @@ -749,7 +744,7 @@ static int usb_serial_probe(struct usb_interface *interface, serial = create_serial(dev, interface, type); if (!serial) { module_put(type->driver.owner); - dev_err(ddev, "%s - out of memory\n", __func__); + dev_err(&interface->dev, "%s - out of memory\n", __func__); return -ENOMEM; } @@ -761,7 +756,7 @@ static int usb_serial_probe(struct usb_interface *interface, retval = type->probe(serial, id); if (retval) { - dev_dbg(ddev, "sub driver rejected device\n"); + dbg("sub driver rejected device"); usb_serial_put(serial); module_put(type->driver.owner); return retval; @@ -776,28 +771,28 @@ static int usb_serial_probe(struct usb_interface *interface, if (usb_endpoint_is_bulk_in(endpoint)) { /* we found a bulk in endpoint */ - dev_dbg(ddev, "found bulk in on endpoint %d\n", i); + dbg("found bulk in on endpoint %d", i); bulk_in_endpoint[num_bulk_in] = endpoint; ++num_bulk_in; } if (usb_endpoint_is_bulk_out(endpoint)) { /* we found a bulk out endpoint */ - dev_dbg(ddev, "found bulk out on endpoint %d\n", i); + dbg("found bulk out on endpoint %d", i); bulk_out_endpoint[num_bulk_out] = endpoint; ++num_bulk_out; } if (usb_endpoint_is_int_in(endpoint)) { /* we found a interrupt in endpoint */ - dev_dbg(ddev, "found interrupt in on endpoint %d\n", i); + dbg("found interrupt in on endpoint %d", i); interrupt_in_endpoint[num_interrupt_in] = endpoint; ++num_interrupt_in; } if (usb_endpoint_is_int_out(endpoint)) { /* we found an interrupt out endpoint */ - dev_dbg(ddev, "found interrupt out on endpoint %d\n", i); + dbg("found interrupt out on endpoint %d", i); interrupt_out_endpoint[num_interrupt_out] = endpoint; ++num_interrupt_out; } @@ -821,7 +816,7 @@ static int usb_serial_probe(struct usb_interface *interface, endpoint = &iface_desc->endpoint[i].desc; if (usb_endpoint_is_int_in(endpoint)) { /* we found a interrupt in endpoint */ - dev_dbg(ddev, "found interrupt in for Prolific device on separate interface\n"); + dbg("found interrupt in for Prolific device on separate interface"); interrupt_in_endpoint[num_interrupt_in] = endpoint; ++num_interrupt_in; } @@ -833,7 +828,7 @@ static int usb_serial_probe(struct usb_interface *interface, * properly during a later invocation of usb_serial_probe */ if (num_bulk_in == 0 || num_bulk_out == 0) { - dev_info(ddev, "PL-2303 hack: descriptors matched but endpoints did not\n"); + dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); usb_serial_put(serial); module_put(type->driver.owner); return -ENODEV; @@ -846,13 +841,14 @@ static int usb_serial_probe(struct usb_interface *interface, if (type == &usb_serial_generic_device) { num_ports = num_bulk_out; if (num_ports == 0) { - dev_err(ddev, "Generic device with no bulk out, not allowed.\n"); + dev_err(&interface->dev, + "Generic device with no bulk out, not allowed.\n"); usb_serial_put(serial); module_put(type->driver.owner); return -EIO; } - dev_info(ddev, "The \"generic\" usb-serial driver is only for testing and one-off prototypes.\n"); - dev_info(ddev, "Tell linux-usb@vger.kernel.org to add your device to a proper driver.\n"); + dev_info(&interface->dev, "The \"generic\" usb-serial driver is only for testing and one-off prototypes.\n"); + dev_info(&interface->dev, "Tell linux-usb@vger.kernel.org to add your device to a proper driver.\n"); } #endif if (!num_ports) { @@ -870,7 +866,8 @@ static int usb_serial_probe(struct usb_interface *interface, serial->num_interrupt_out = num_interrupt_out; /* found all that we need */ - dev_info(ddev, "%s converter detected\n", type->description); + dev_info(&interface->dev, "%s converter detected\n", + type->description); /* create our ports, we need as many as the max endpoints */ /* we don't use num_ports here because some devices have more @@ -881,7 +878,8 @@ static int usb_serial_probe(struct usb_interface *interface, max_endpoints = max(max_endpoints, (int)serial->num_ports); serial->num_port_pointers = max_endpoints; - dev_dbg(ddev, "setting up %d port structures for this device", max_endpoints); + dbg("%s - setting up %d port structures for this device", + __func__, max_endpoints); for (i = 0; i < max_endpoints; ++i) { port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); if (!port) @@ -914,13 +912,15 @@ static int usb_serial_probe(struct usb_interface *interface, set_bit(j, &port->read_urbs_free); port->read_urbs[j] = usb_alloc_urb(0, GFP_KERNEL); if (!port->read_urbs[j]) { - dev_err(ddev, "No free urbs available\n"); + dev_err(&interface->dev, + "No free urbs available\n"); goto probe_error; } port->bulk_in_buffers[j] = kmalloc(buffer_size, GFP_KERNEL); if (!port->bulk_in_buffers[j]) { - dev_err(ddev, "Couldn't allocate bulk_in_buffer\n"); + dev_err(&interface->dev, + "Couldn't allocate bulk_in_buffer\n"); goto probe_error; } usb_fill_bulk_urb(port->read_urbs[j], dev, @@ -950,13 +950,15 @@ static int usb_serial_probe(struct usb_interface *interface, set_bit(j, &port->write_urbs_free); port->write_urbs[j] = usb_alloc_urb(0, GFP_KERNEL); if (!port->write_urbs[j]) { - dev_err(ddev, "No free urbs available\n"); + dev_err(&interface->dev, + "No free urbs available\n"); goto probe_error; } port->bulk_out_buffers[j] = kmalloc(buffer_size, GFP_KERNEL); if (!port->bulk_out_buffers[j]) { - dev_err(ddev, "Couldn't allocate bulk_out_buffer\n"); + dev_err(&interface->dev, + "Couldn't allocate bulk_out_buffer\n"); goto probe_error; } usb_fill_bulk_urb(port->write_urbs[j], dev, @@ -977,7 +979,8 @@ static int usb_serial_probe(struct usb_interface *interface, port = serial->port[i]; port->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); if (!port->interrupt_in_urb) { - dev_err(ddev, "No free urbs available\n"); + dev_err(&interface->dev, + "No free urbs available\n"); goto probe_error; } buffer_size = usb_endpoint_maxp(endpoint); @@ -986,7 +989,8 @@ static int usb_serial_probe(struct usb_interface *interface, port->interrupt_in_buffer = kmalloc(buffer_size, GFP_KERNEL); if (!port->interrupt_in_buffer) { - dev_err(ddev, "Couldn't allocate interrupt_in_buffer\n"); + dev_err(&interface->dev, + "Couldn't allocate interrupt_in_buffer\n"); goto probe_error; } usb_fill_int_urb(port->interrupt_in_urb, dev, @@ -997,7 +1001,7 @@ static int usb_serial_probe(struct usb_interface *interface, endpoint->bInterval); } } else if (num_interrupt_in) { - dev_dbg(ddev, "The device claims to support interrupt in transfers, but read_int_callback is not defined\n"); + dbg("the device claims to support interrupt in transfers, but read_int_callback is not defined"); } if (serial->type->write_int_callback) { @@ -1006,7 +1010,8 @@ static int usb_serial_probe(struct usb_interface *interface, port = serial->port[i]; port->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); if (!port->interrupt_out_urb) { - dev_err(ddev, "No free urbs available\n"); + dev_err(&interface->dev, + "No free urbs available\n"); goto probe_error; } buffer_size = usb_endpoint_maxp(endpoint); @@ -1016,7 +1021,8 @@ static int usb_serial_probe(struct usb_interface *interface, port->interrupt_out_buffer = kmalloc(buffer_size, GFP_KERNEL); if (!port->interrupt_out_buffer) { - dev_err(ddev, "Couldn't allocate interrupt_out_buffer\n"); + dev_err(&interface->dev, + "Couldn't allocate interrupt_out_buffer\n"); goto probe_error; } usb_fill_int_urb(port->interrupt_out_urb, dev, @@ -1027,7 +1033,7 @@ static int usb_serial_probe(struct usb_interface *interface, endpoint->bInterval); } } else if (num_interrupt_out) { - dev_dbg(ddev, "The device claims to support interrupt out transfers, but write_int_callback is not defined\n"); + dbg("the device claims to support interrupt out transfers, but write_int_callback is not defined"); } usb_set_intfdata(interface, serial); @@ -1055,7 +1061,7 @@ static int usb_serial_probe(struct usb_interface *interface, serial->disconnected = 1; if (get_free_serial(serial, num_ports, &minor) == NULL) { - dev_err(ddev, "No more free serial devices\n"); + dev_err(&interface->dev, "No more free serial devices\n"); goto probe_error; } serial->minor = minor; @@ -1064,12 +1070,13 @@ static int usb_serial_probe(struct usb_interface *interface, for (i = 0; i < num_ports; ++i) { port = serial->port[i]; dev_set_name(&port->dev, "ttyUSB%d", port->number); - dev_dbg(ddev, "registering %s", dev_name(&port->dev)); + dbg ("%s - registering %s", __func__, dev_name(&port->dev)); device_enable_async_suspend(&port->dev); retval = device_add(&port->dev); if (retval) - dev_err(ddev, "Error registering port device, continuing\n"); + dev_err(&port->dev, "Error registering port device, " + "continuing\n"); } serial->disconnected = 0; @@ -1093,6 +1100,7 @@ static void usb_serial_disconnect(struct usb_interface *interface) struct usb_serial_port *port; usb_serial_console_disconnect(serial); + dbg("%s", __func__); mutex_lock(&serial->disc_mutex); /* must set a flag, to signal subdrivers */ @@ -1227,7 +1235,8 @@ static int __init usb_serial_init(void) result = bus_register(&usb_serial_bus_type); if (result) { - pr_err("%s - registering bus driver failed\n", __func__); + printk(KERN_ERR "usb-serial: %s - registering bus driver " + "failed\n", __func__); goto exit_bus; } @@ -1247,21 +1256,24 @@ static int __init usb_serial_init(void) tty_set_operations(usb_serial_tty_driver, &serial_ops); result = tty_register_driver(usb_serial_tty_driver); if (result) { - pr_err("%s - tty_register_driver failed\n", __func__); + printk(KERN_ERR "usb-serial: %s - tty_register_driver failed\n", + __func__); goto exit_reg_driver; } /* register the USB driver */ result = usb_register(&usb_serial_driver); if (result < 0) { - pr_err("%s - usb_register failed\n", __func__); + printk(KERN_ERR "usb-serial: %s - usb_register failed\n", + __func__); goto exit_tty; } /* register the generic driver, if we should */ result = usb_serial_generic_register(debug); if (result < 0) { - pr_err("%s - registering generic driver failed\n", __func__); + printk(KERN_ERR "usb-serial: %s - registering generic " + "driver failed\n", __func__); goto exit_generic; } @@ -1279,7 +1291,8 @@ static int __init usb_serial_init(void) bus_unregister(&usb_serial_bus_type); exit_bus: - pr_err("%s - returning with error %d\n", __func__, result); + printk(KERN_ERR "usb-serial: %s - returning with error %d\n", + __func__, result); put_tty_driver(usb_serial_tty_driver); return result; } @@ -1305,7 +1318,7 @@ module_exit(usb_serial_exit); do { \ if (!type->function) { \ type->function = usb_serial_generic_##function; \ - pr_debug("Had to override the " #function \ + dbg("Had to override the " #function \ " usb serial operation with the generic one.");\ } \ } while (0) @@ -1348,7 +1361,8 @@ static int usb_serial_register(struct usb_serial_driver *driver) retval = usb_serial_bus_register(driver); if (retval) { - pr_err("problem %d when registering driver %s\n", retval, driver->description); + printk(KERN_ERR "usb-serial: problem %d when registering " + "driver %s\n", retval, driver->description); list_del(&driver->driver_list); } else printk(KERN_INFO "USB Serial support registered for %s\n",