diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-22 15:50:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-22 15:50:46 -0700 |
commit | a481991467d38afb43c3921d5b5b59ccb61b04ba (patch) | |
tree | a4b0b9a14da6fd5ef7b9b512bb32dbfcfcf2cd71 /drivers/usb/serial/generic.c | |
parent | f6a26ae7699416d86bea8cb68ce413571e9cab3c (diff) | |
parent | cda4db53e9c28061c100400e1a4d273ea61dfba9 (diff) |
Merge tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB 3.5-rc1 changes from Greg Kroah-Hartman:
"Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window.
It's touches a lot of different parts of the kernel, all USB drivers,
due to some API cleanups (getting rid of the ancient err() macro) and
some changes that are needed for USB 3.0 power management updates.
There are also lots of new drivers, pimarily gadget, but others as
well. We deleted a staging driver, which was nice, and finally
dropped the obsolete usbfs code, which will make Al happy to never
have to touch that again.
There were some build errors in the tree that linux-next found a few
days ago, but those were fixed by the most recent changes (all were
due to us not building with CONFIG_PM disabled.)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (477 commits)
xhci: Fix DIV_ROUND_UP compile error.
xhci: Fix compile with CONFIG_USB_SUSPEND=n
USB: Fix core compile with CONFIG_USB_SUSPEND=n
brcm80211: Fix compile error for .disable_hub_initiated_lpm.
Revert "USB: EHCI: work around bug in the Philips ISP1562 controller"
MAINTAINERS: Add myself as maintainer to the USB PHY Layer
USB: EHCI: fix command register configuration lost problem
USB: Remove races in devio.c
USB: ehci-platform: remove update_device
USB: Disable hub-initiated LPM for comms devices.
xhci: Add Intel U1/U2 timeout policy.
xhci: Add infrastructure for host-specific LPM policies.
USB: Add macros for interrupt endpoint types.
xhci: Reserve one command for USB3 LPM disable.
xhci: Some Evaluate Context commands must succeed.
USB: Disable USB 3.0 LPM in critical sections.
USB: Add support to enable/disable USB3 link states.
USB: Allow drivers to disable hub-initiated LPM.
USB: Calculate USB 3.0 exit latencies for LPM.
USB: Refactor code to set LPM support flag.
...
Conflicts:
arch/arm/mach-exynos/mach-nuri.c
arch/arm/mach-exynos/mach-universal_c210.c
drivers/net/wireless/ath/ath6kl/usb.c
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r-- | drivers/usb/serial/generic.c | 68 |
1 files changed, 15 insertions, 53 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 664deb63807..105a6d898ca 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -28,9 +28,6 @@ static int debug; #ifdef CONFIG_USB_SERIAL_GENERIC -static int generic_probe(struct usb_interface *interface, - const struct usb_device_id *id); - static __u16 vendor = 0x05f9; static __u16 product = 0xffff; @@ -49,13 +46,6 @@ static const struct usb_device_id generic_serial_ids[] = { {} }; -static struct usb_driver generic_driver = { - .name = "usbserial_generic", - .probe = generic_probe, - .disconnect = usb_serial_disconnect, - .id_table = generic_serial_ids, -}; - /* All of the device info needed for the Generic Serial Converter */ struct usb_serial_driver usb_serial_generic_device = { .driver = { @@ -75,16 +65,6 @@ static struct usb_serial_driver * const serial_drivers[] = { &usb_serial_generic_device, NULL }; -static int generic_probe(struct usb_interface *interface, - const struct usb_device_id *id) -{ - const struct usb_device_id *id_pattern; - - id_pattern = usb_match_id(interface, generic_device_ids); - if (id_pattern != NULL) - return usb_serial_probe(interface, id); - return -ENODEV; -} #endif int usb_serial_generic_register(int _debug) @@ -99,7 +79,7 @@ int usb_serial_generic_register(int _debug) USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; /* register our generic driver with ourselves */ - retval = usb_serial_register_drivers(&generic_driver, serial_drivers); + retval = usb_serial_register_drivers(serial_drivers, "usbserial_generic", generic_serial_ids); #endif return retval; } @@ -108,7 +88,7 @@ void usb_serial_generic_deregister(void) { #ifdef CONFIG_USB_SERIAL_GENERIC /* remove our generic driver */ - usb_serial_deregister_drivers(&generic_driver, serial_drivers); + usb_serial_deregister_drivers(serial_drivers); #endif } @@ -117,8 +97,6 @@ int usb_serial_generic_open(struct tty_struct *tty, struct usb_serial_port *port int result = 0; unsigned long flags; - dbg("%s - port %d", __func__, port->number); - /* clear the throttle flags */ spin_lock_irqsave(&port->lock, flags); port->throttled = 0; @@ -139,12 +117,9 @@ static void generic_cleanup(struct usb_serial_port *port) unsigned long flags; int i; - dbg("%s - port %d", __func__, port->number); - if (serial->dev) { /* shutdown any bulk transfers that might be going on */ if (port->bulk_out_size) { - usb_kill_urb(port->write_urb); for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) usb_kill_urb(port->write_urbs[i]); @@ -161,7 +136,6 @@ static void generic_cleanup(struct usb_serial_port *port) void usb_serial_generic_close(struct usb_serial_port *port) { - dbg("%s - port %d", __func__, port->number); generic_cleanup(port); } EXPORT_SYMBOL_GPL(usb_serial_generic_close); @@ -249,8 +223,6 @@ int usb_serial_generic_write(struct tty_struct *tty, { int result; - dbg("%s - port %d", __func__, port->number); - /* only do something if we have a bulk out endpoint */ if (!port->bulk_out_size) return -ENODEV; @@ -273,8 +245,6 @@ int usb_serial_generic_write_room(struct tty_struct *tty) unsigned long flags; int room; - dbg("%s - port %d", __func__, port->number); - if (!port->bulk_out_size) return 0; @@ -282,7 +252,7 @@ int usb_serial_generic_write_room(struct tty_struct *tty) room = kfifo_avail(&port->write_fifo); spin_unlock_irqrestore(&port->lock, flags); - dbg("%s - returns %d", __func__, room); + dev_dbg(&port->dev, "%s - returns %d\n", __func__, room); return room; } @@ -292,8 +262,6 @@ int usb_serial_generic_chars_in_buffer(struct tty_struct *tty) unsigned long flags; int chars; - dbg("%s - port %d", __func__, port->number); - if (!port->bulk_out_size) return 0; @@ -301,7 +269,7 @@ int usb_serial_generic_chars_in_buffer(struct tty_struct *tty) chars = kfifo_len(&port->write_fifo) + port->tx_bytes; spin_unlock_irqrestore(&port->lock, flags); - dbg("%s - returns %d", __func__, chars); + dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars); return chars; } @@ -313,7 +281,8 @@ static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, if (!test_and_clear_bit(index, &port->read_urbs_free)) return 0; - dbg("%s - port %d, urb %d\n", __func__, port->number, index); + dev_dbg(&port->dev, "%s - port %d, urb %d\n", __func__, + port->number, index); res = usb_submit_urb(port->read_urbs[index], mem_flags); if (res) { @@ -335,8 +304,6 @@ int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, int res; int i; - dbg("%s - port %d", __func__, port->number); - for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) { res = usb_serial_generic_submit_read_urb(port, i, mem_flags); if (res) @@ -395,10 +362,12 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb) } set_bit(i, &port->read_urbs_free); - dbg("%s - port %d, urb %d, len %d\n", __func__, port->number, i, - urb->actual_length); + dev_dbg(&port->dev, "%s - port %d, urb %d, len %d\n", + __func__, port->number, i, urb->actual_length); + if (urb->status) { - dbg("%s - non-zero urb status: %d\n", __func__, urb->status); + dev_dbg(&port->dev, "%s - non-zero urb status: %d\n", + __func__, urb->status); return; } @@ -424,8 +393,6 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb) int status = urb->status; int i; - dbg("%s - port %d", __func__, port->number); - for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) if (port->write_urbs[i] == urb) break; @@ -436,7 +403,8 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb) spin_unlock_irqrestore(&port->lock, flags); if (status) { - dbg("%s - non-zero urb status: %d", __func__, status); + dev_dbg(&port->dev, "%s - non-zero urb status: %d\n", + __func__, status); spin_lock_irqsave(&port->lock, flags); kfifo_reset_out(&port->write_fifo); @@ -454,8 +422,6 @@ void usb_serial_generic_throttle(struct tty_struct *tty) struct usb_serial_port *port = tty->driver_data; unsigned long flags; - dbg("%s - port %d", __func__, port->number); - /* Set the throttle request flag. It will be picked up * by usb_serial_generic_read_bulk_callback(). */ spin_lock_irqsave(&port->lock, flags); @@ -469,8 +435,6 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty) struct usb_serial_port *port = tty->driver_data; int was_throttled; - dbg("%s - port %d", __func__, port->number); - /* Clear the throttle flags */ spin_lock_irq(&port->lock); was_throttled = port->throttled; @@ -525,7 +489,8 @@ void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, { struct tty_port *port = &usb_port->port; - dbg("%s - port %d, status %d", __func__, usb_port->number, status); + dev_dbg(&usb_port->dev, "%s - port %d, status %d\n", __func__, + usb_port->number, status); if (status) wake_up_interruptible(&port->open_wait); @@ -566,8 +531,6 @@ void usb_serial_generic_disconnect(struct usb_serial *serial) { int i; - dbg("%s", __func__); - /* stop reads and writes on all ports */ for (i = 0; i < serial->num_ports; ++i) generic_cleanup(serial->port[i]); @@ -576,5 +539,4 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_disconnect); void usb_serial_generic_release(struct usb_serial *serial) { - dbg("%s", __func__); } |