diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-25 12:40:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-25 12:40:57 -0700 |
commit | 37b05b17985ecc43a33e2a8cbdaa220115de4703 (patch) | |
tree | 8213bf790182711677018ed322a9ccf61470242e /drivers/usb/serial/ir-usb.c | |
parent | ce1d5b23a8d1e19866ab82bdec0dc41fde5273d8 (diff) | |
parent | 4953d141dc5db748475001cfbfdcc42e66cf900e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (120 commits)
usb: don't update devnum for wusb devices
wusb: make ep0_reinit available for modules
wusb: devices dont use a set address
wusb: teach choose_address() about wireless devices
wusb: add link wusb-usb device
wusb: add authenticathed bit to usb_dev
USB: remove unnecessary type casting of urb->context
usb serial: more fixes and groundwork for tty changes
USB: replace remaining __FUNCTION__ occurrences
USB: usbfs: export the URB_NO_INTERRUPT flag to userspace
USB: fix compile problems in ehci-hcd
USB: ehci: qh_completions cleanup and bugfix
USB: cdc-acm: signedness fix
USB: add documentation about callbacks
USB: don't explicitly reenable root-hub status interrupts
USB: OHCI: turn off RD when remote wakeup is disabled
USB: HCDs use the do_remote_wakeup flag
USB: g_file_storage: ignore bulk-out data after invalid CBW
USB: serial: remove endpoints setting checks from core and header
USB: serial: remove unneeded number endpoints settings
...
Diffstat (limited to 'drivers/usb/serial/ir-usb.c')
-rw-r--r-- | drivers/usb/serial/ir-usb.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index 6b803ab9854..004d57385a7 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -145,9 +145,6 @@ static struct usb_serial_driver ir_device = { .description = "IR Dongle", .usb_driver = &ir_driver, .id_table = id_table, - .num_interrupt_in = 1, - .num_bulk_in = 1, - .num_bulk_out = 1, .num_ports = 1, .set_termios = ir_set_termios, .attach = ir_startup, @@ -198,16 +195,16 @@ static struct irda_class_desc *irda_usb_find_class_desc(struct usb_device *dev, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, ifnum, desc, sizeof(*desc), 1000); - dbg("%s - ret=%d", __FUNCTION__, ret); + dbg("%s - ret=%d", __func__, ret); if (ret < sizeof(*desc)) { dbg("%s - class descriptor read %s (%d)", - __FUNCTION__, + __func__, (ret<0) ? "failed" : "too short", ret); goto error; } if (desc->bDescriptorType != USB_DT_IRDA) { - dbg("%s - bad class descriptor type", __FUNCTION__); + dbg("%s - bad class descriptor type", __func__); goto error; } @@ -251,7 +248,7 @@ static int ir_startup (struct usb_serial *serial) } dbg ("%s - Baud rates supported:%s%s%s%s%s%s%s%s%s", - __FUNCTION__, + __func__, (irda_desc->wBaudRate & 0x0001) ? " 2400" : "", (irda_desc->wBaudRate & 0x0002) ? " 9600" : "", (irda_desc->wBaudRate & 0x0004) ? " 19200" : "", @@ -284,13 +281,13 @@ static int ir_open (struct usb_serial_port *port, struct file *filp) char *buffer; int result = 0; - dbg("%s - port %d", __FUNCTION__, port->number); + dbg("%s - port %d", __func__, port->number); if (buffer_size) { /* override the default buffer sizes */ buffer = kmalloc (buffer_size, GFP_KERNEL); if (!buffer) { - dev_err (&port->dev, "%s - out of memory.\n", __FUNCTION__); + dev_err (&port->dev, "%s - out of memory.\n", __func__); return -ENOMEM; } kfree (port->read_urb->transfer_buffer); @@ -299,7 +296,7 @@ static int ir_open (struct usb_serial_port *port, struct file *filp) buffer = kmalloc (buffer_size, GFP_KERNEL); if (!buffer) { - dev_err (&port->dev, "%s - out of memory.\n", __FUNCTION__); + dev_err (&port->dev, "%s - out of memory.\n", __func__); return -ENOMEM; } kfree (port->write_urb->transfer_buffer); @@ -319,14 +316,14 @@ static int ir_open (struct usb_serial_port *port, struct file *filp) port); result = usb_submit_urb(port->read_urb, GFP_KERNEL); if (result) - dev_err(&port->dev, "%s - failed submitting read urb, error %d\n", __FUNCTION__, result); + dev_err(&port->dev, "%s - failed submitting read urb, error %d\n", __func__, result); return result; } static void ir_close (struct usb_serial_port *port, struct file * filp) { - dbg("%s - port %d", __FUNCTION__, port->number); + dbg("%s - port %d", __func__, port->number); /* shutdown our bulk read */ usb_kill_urb(port->read_urb); @@ -338,10 +335,10 @@ static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int int result; int transfer_size; - dbg("%s - port = %d, count = %d", __FUNCTION__, port->number, count); + dbg("%s - port = %d, count = %d", __func__, port->number, count); if (!port->tty) { - dev_err (&port->dev, "%s - no tty???\n", __FUNCTION__); + dev_err (&port->dev, "%s - no tty???\n", __func__); return 0; } @@ -351,7 +348,7 @@ static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int spin_lock_bh(&port->lock); if (port->write_urb_busy) { spin_unlock_bh(&port->lock); - dbg("%s - already writing", __FUNCTION__); + dbg("%s - already writing", __func__); return 0; } port->write_urb_busy = 1; @@ -387,7 +384,7 @@ static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int result = usb_submit_urb (port->write_urb, GFP_ATOMIC); if (result) { port->write_urb_busy = 0; - dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__, result); + dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __func__, result); } else result = transfer_size; @@ -396,22 +393,22 @@ static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int static void ir_write_bulk_callback (struct urb *urb) { - struct usb_serial_port *port = (struct usb_serial_port *)urb->context; + struct usb_serial_port *port = urb->context; int status = urb->status; - dbg("%s - port %d", __FUNCTION__, port->number); + dbg("%s - port %d", __func__, port->number); port->write_urb_busy = 0; if (status) { dbg("%s - nonzero write bulk status received: %d", - __FUNCTION__, status); + __func__, status); return; } usb_serial_debug_data ( debug, &port->dev, - __FUNCTION__, + __func__, urb->actual_length, urb->transfer_buffer); @@ -420,16 +417,16 @@ static void ir_write_bulk_callback (struct urb *urb) static void ir_read_bulk_callback (struct urb *urb) { - struct usb_serial_port *port = (struct usb_serial_port *)urb->context; + struct usb_serial_port *port = urb->context; struct tty_struct *tty; unsigned char *data = urb->transfer_buffer; int result; int status = urb->status; - dbg("%s - port %d", __FUNCTION__, port->number); + dbg("%s - port %d", __func__, port->number); if (!port->open_count) { - dbg("%s - port closed.", __FUNCTION__); + dbg("%s - port closed.", __func__); return; } @@ -447,7 +444,7 @@ static void ir_read_bulk_callback (struct urb *urb) usb_serial_debug_data ( debug, &port->dev, - __FUNCTION__, + __func__, urb->actual_length, data); @@ -480,13 +477,13 @@ static void ir_read_bulk_callback (struct urb *urb) result = usb_submit_urb(port->read_urb, GFP_ATOMIC); if (result) dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", - __FUNCTION__, result); + __func__, result); break ; default: dbg("%s - nonzero read bulk status received: %d", - __FUNCTION__, + __func__, status); break ; @@ -502,7 +499,7 @@ static void ir_set_termios (struct usb_serial_port *port, struct ktermios *old_t speed_t baud; int ir_baud; - dbg("%s - port %d", __FUNCTION__, port->number); + dbg("%s - port %d", __func__, port->number); baud = tty_get_baud_rate(port->tty); @@ -554,7 +551,7 @@ static void ir_set_termios (struct usb_serial_port *port, struct ktermios *old_t result = usb_submit_urb (port->write_urb, GFP_KERNEL); if (result) - dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__, result); + dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __func__, result); /* Only speed changes are supported */ tty_termios_copy_hw(port->tty->termios, old_termios); |