Commit 8d99c8a3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: drivers/usb/serial/ fixups due to dev_printk change

parent 8b1601ab
...@@ -66,7 +66,7 @@ static int usb_serial_device_probe (struct device *dev) ...@@ -66,7 +66,7 @@ static int usb_serial_device_probe (struct device *dev)
driver = port->serial->type; driver = port->serial->type;
if (driver->port_probe) { if (driver->port_probe) {
if (!try_module_get(driver->owner)) { if (!try_module_get(driver->owner)) {
dev_err(*dev, "module get failed, exiting\n"); dev_err(dev, "module get failed, exiting\n");
retval = -EIO; retval = -EIO;
goto exit; goto exit;
} }
...@@ -79,7 +79,8 @@ static int usb_serial_device_probe (struct device *dev) ...@@ -79,7 +79,8 @@ static int usb_serial_device_probe (struct device *dev)
minor = port->number; minor = port->number;
tty_register_device (&usb_serial_tty_driver, minor); tty_register_device (&usb_serial_tty_driver, minor);
dev_info(*dev, "%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)\n", dev_info(&port->serial->dev->dev,
"%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)\n",
driver->name, minor, minor); driver->name, minor, minor);
exit: exit:
...@@ -101,7 +102,7 @@ static int usb_serial_device_remove (struct device *dev) ...@@ -101,7 +102,7 @@ static int usb_serial_device_remove (struct device *dev)
driver = port->serial->type; driver = port->serial->type;
if (driver->port_remove) { if (driver->port_remove) {
if (!try_module_get(driver->owner)) { if (!try_module_get(driver->owner)) {
dev_err(*dev, "module get failed, exiting\n"); dev_err(dev, "module get failed, exiting\n");
retval = -EIO; retval = -EIO;
goto exit; goto exit;
} }
...@@ -111,7 +112,7 @@ static int usb_serial_device_remove (struct device *dev) ...@@ -111,7 +112,7 @@ static int usb_serial_device_remove (struct device *dev)
exit: exit:
minor = port->number; minor = port->number;
tty_unregister_device (&usb_serial_tty_driver, minor); tty_unregister_device (&usb_serial_tty_driver, minor);
dev_info(*dev, "%s converter now disconnected from ttyUSB%d\n", dev_info(dev, "%s converter now disconnected from ttyUSB%d\n",
driver->name, minor); driver->name, minor);
return retval; return retval;
......
...@@ -181,7 +181,7 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp) ...@@ -181,7 +181,7 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
result = usb_submit_urb(port->read_urb, GFP_KERNEL); result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) 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", __FUNCTION__, result);
return result; return result;
} }
...@@ -205,7 +205,7 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp) ...@@ -205,7 +205,7 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp)
usb_unlink_urb (port->read_urb); usb_unlink_urb (port->read_urb);
} }
/* Uncomment the following line if you want to see some statistics in your syslog */ /* Uncomment the following line if you want to see some statistics in your syslog */
/* dev_info (port->dev, "Bytes In = %d Bytes Out = %d\n", bytes_in, bytes_out); */ /* dev_info (&port->dev, "Bytes In = %d Bytes Out = %d\n", bytes_in, bytes_out); */
} }
...@@ -248,7 +248,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -248,7 +248,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
if (urb->transfer_buffer == NULL) { if (urb->transfer_buffer == NULL) {
urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC); urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC);
if (urb->transfer_buffer == NULL) { if (urb->transfer_buffer == NULL) {
dev_err(port->dev, "%s no more kernel memory...\n", __FUNCTION__); dev_err(&port->dev, "%s no more kernel memory...\n", __FUNCTION__);
goto exit; goto exit;
} }
} }
...@@ -278,7 +278,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -278,7 +278,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
/* send it down the pipe */ /* send it down the pipe */
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status) { if (status) {
dev_err(port->dev, "%s - usb_submit_urb(write bulk) failed with status = %d\n", __FUNCTION__, status); dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed with status = %d\n", __FUNCTION__, status);
bytes_sent = status; bytes_sent = status;
break; break;
} }
...@@ -426,7 +426,7 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -426,7 +426,7 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
dev_err(urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); dev_err(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
return; return;
...@@ -451,7 +451,7 @@ static void empeg_unthrottle (struct usb_serial_port *port) ...@@ -451,7 +451,7 @@ static void empeg_unthrottle (struct usb_serial_port *port)
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) 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", __FUNCTION__, result);
return; return;
} }
......
...@@ -41,7 +41,7 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da ...@@ -41,7 +41,7 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da
transfer_buffer = kmalloc (length, GFP_KERNEL); transfer_buffer = kmalloc (length, GFP_KERNEL);
if (!transfer_buffer) { if (!transfer_buffer) {
dev_err(serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, length); dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, length);
return -ENOMEM; return -ENOMEM;
} }
memcpy (transfer_buffer, data, length); memcpy (transfer_buffer, data, length);
...@@ -56,7 +56,7 @@ int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit) ...@@ -56,7 +56,7 @@ int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit)
dbg("%s - %d", __FUNCTION__, reset_bit); dbg("%s - %d", __FUNCTION__, reset_bit);
response = ezusb_writememory (serial, CPUCS_REG, &reset_bit, 1, 0xa0); response = ezusb_writememory (serial, CPUCS_REG, &reset_bit, 1, 0xa0);
if (response < 0) { if (response < 0) {
dev_err(serial->dev->dev, "%s- %d failed\n", __FUNCTION__, reset_bit); dev_err(&serial->dev->dev, "%s- %d failed\n", __FUNCTION__, reset_bit);
} }
return response; return response;
} }
......
...@@ -106,7 +106,7 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp) ...@@ -106,7 +106,7 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp)
port); port);
result = usb_submit_urb(port->read_urb, GFP_KERNEL); result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) if (result)
dev_err(port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
} }
return result; return result;
...@@ -176,7 +176,7 @@ int usb_serial_generic_write (struct usb_serial_port *port, int from_user, const ...@@ -176,7 +176,7 @@ int usb_serial_generic_write (struct usb_serial_port *port, int from_user, const
/* send the data out the bulk port */ /* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) 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", __FUNCTION__, result);
else else
result = count; result = count;
...@@ -266,7 +266,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg ...@@ -266,7 +266,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg
usb_serial_generic_read_bulk_callback), port); usb_serial_generic_read_bulk_callback), port);
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
dev_err(port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
} }
void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs) void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
......
...@@ -572,7 +572,7 @@ static void update_edgeport_E2PROM (struct edgeport_serial *edge_serial) ...@@ -572,7 +572,7 @@ static void update_edgeport_E2PROM (struct edgeport_serial *edge_serial)
record = (struct edge_firmware_image_record *)firmware; record = (struct edge_firmware_image_record *)firmware;
response = rom_write (edge_serial->serial, record->ExtAddr, record->Addr, record->Len, &record->Data[0]); response = rom_write (edge_serial->serial, record->ExtAddr, record->Addr, record->Len, &record->Data[0]);
if (response < 0) { if (response < 0) {
dev_err(edge_serial->serial->dev->dev, "sram_write failed (%x, %x, %d)\n", record->ExtAddr, record->Addr, record->Len); dev_err(&edge_serial->serial->dev->dev, "sram_write failed (%x, %x, %d)\n", record->ExtAddr, record->Addr, record->Len);
break; break;
} }
firmware += sizeof (struct edge_firmware_image_record) + record->Len; firmware += sizeof (struct edge_firmware_image_record) + record->Len;
...@@ -840,7 +840,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs) ...@@ -840,7 +840,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
exit: exit:
result = usb_submit_urb (urb, GFP_ATOMIC); result = usb_submit_urb (urb, GFP_ATOMIC);
if (result) { if (result) {
dev_err(urb->dev->dev, "%s - Error %d submitting control urb\n", __FUNCTION__, result); dev_err(&urb->dev->dev, "%s - Error %d submitting control urb\n", __FUNCTION__, result);
} }
} }
...@@ -889,7 +889,7 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs) ...@@ -889,7 +889,7 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
edge_serial->read_urb->dev = edge_serial->serial->dev; edge_serial->read_urb->dev = edge_serial->serial->dev;
status = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); status = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC);
if (status) { if (status) {
dev_err(urb->dev->dev, "%s - usb_submit_urb(read bulk) failed, status = %d\n", __FUNCTION__, status); dev_err(&urb->dev->dev, "%s - usb_submit_urb(read bulk) failed, status = %d\n", __FUNCTION__, status);
} }
} }
} }
...@@ -1057,7 +1057,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp) ...@@ -1057,7 +1057,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
* this interrupt will continue as long as the edgeport is connected */ * this interrupt will continue as long as the edgeport is connected */
response = usb_submit_urb (edge_serial->interrupt_read_urb, GFP_KERNEL); response = usb_submit_urb (edge_serial->interrupt_read_urb, GFP_KERNEL);
if (response) { if (response) {
dev_err(port->dev, "%s - Error %d submitting control urb\n", __FUNCTION__, response); dev_err(&port->dev, "%s - Error %d submitting control urb\n", __FUNCTION__, response);
} }
} }
...@@ -1081,7 +1081,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp) ...@@ -1081,7 +1081,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
response = send_iosp_ext_cmd (edge_port, IOSP_CMD_OPEN_PORT, 0); response = send_iosp_ext_cmd (edge_port, IOSP_CMD_OPEN_PORT, 0);
if (response < 0) { if (response < 0) {
dev_err(port->dev, "%s - error sending open port command\n", __FUNCTION__); dev_err(&port->dev, "%s - error sending open port command\n", __FUNCTION__);
edge_port->openPending = FALSE; edge_port->openPending = FALSE;
return -ENODEV; return -ENODEV;
} }
...@@ -1450,7 +1450,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge ...@@ -1450,7 +1450,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
count = fifo->count; count = fifo->count;
buffer = kmalloc (count+2, GFP_ATOMIC); buffer = kmalloc (count+2, GFP_ATOMIC);
if (buffer == NULL) { if (buffer == NULL) {
dev_err(edge_serial->serial->dev->dev, "%s - no more kernel memory...\n", __FUNCTION__); dev_err(&edge_serial->serial->dev->dev, "%s - no more kernel memory...\n", __FUNCTION__);
edge_port->write_in_progress = FALSE; edge_port->write_in_progress = FALSE;
return; return;
} }
...@@ -2143,7 +2143,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2 ...@@ -2143,7 +2143,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
} }
edge_port = usb_get_serial_port_data(port); edge_port = usb_get_serial_port_data(port);
if (edge_port == NULL) { if (edge_port == NULL) {
dev_err(edge_serial->serial->dev->dev, "%s - edge_port == NULL for port %d\n", __FUNCTION__, edge_serial->rxPort); dev_err(&edge_serial->serial->dev->dev, "%s - edge_port == NULL for port %d\n", __FUNCTION__, edge_serial->rxPort);
return; return;
} }
...@@ -2330,7 +2330,7 @@ static int sram_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u ...@@ -2330,7 +2330,7 @@ static int sram_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u
transfer_buffer = kmalloc (64, GFP_KERNEL); transfer_buffer = kmalloc (64, GFP_KERNEL);
if (!transfer_buffer) { if (!transfer_buffer) {
dev_err(serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2375,7 +2375,7 @@ static int rom_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u1 ...@@ -2375,7 +2375,7 @@ static int rom_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u1
transfer_buffer = kmalloc (64, GFP_KERNEL); transfer_buffer = kmalloc (64, GFP_KERNEL);
if (!transfer_buffer) { if (!transfer_buffer) {
dev_err(serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2420,7 +2420,7 @@ static int rom_read (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16 ...@@ -2420,7 +2420,7 @@ static int rom_read (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16
transfer_buffer = kmalloc (64, GFP_KERNEL); transfer_buffer = kmalloc (64, GFP_KERNEL);
if (!transfer_buffer) { if (!transfer_buffer) {
dev_err(serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2463,7 +2463,7 @@ static int send_iosp_ext_cmd (struct edgeport_port *edge_port, __u8 command, __u ...@@ -2463,7 +2463,7 @@ static int send_iosp_ext_cmd (struct edgeport_port *edge_port, __u8 command, __u
buffer = kmalloc (10, GFP_ATOMIC); buffer = kmalloc (10, GFP_ATOMIC);
if (!buffer) { if (!buffer) {
dev_err(edge_port->port->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 10); dev_err(&edge_port->port->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 10);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2554,14 +2554,14 @@ static int send_cmd_write_baud_rate (struct edgeport_port *edge_port, int baudRa ...@@ -2554,14 +2554,14 @@ static int send_cmd_write_baud_rate (struct edgeport_port *edge_port, int baudRa
status = calc_baud_rate_divisor (baudRate, &divisor); status = calc_baud_rate_divisor (baudRate, &divisor);
if (status) { if (status) {
dev_err(edge_port->port->dev, "%s - bad baud rate\n", __FUNCTION__); dev_err(&edge_port->port->dev, "%s - bad baud rate\n", __FUNCTION__);
return status; return status;
} }
// Alloc memory for the string of commands. // Alloc memory for the string of commands.
cmdBuffer = kmalloc (0x100, GFP_ATOMIC); cmdBuffer = kmalloc (0x100, GFP_ATOMIC);
if (!cmdBuffer) { if (!cmdBuffer) {
dev_err(edge_port->port->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 0x100); dev_err(&edge_port->port->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 0x100);
return -ENOMEM; return -ENOMEM;
} }
currCmd = cmdBuffer; currCmd = cmdBuffer;
...@@ -2838,7 +2838,7 @@ static void get_manufacturing_desc (struct edgeport_serial *edge_serial) ...@@ -2838,7 +2838,7 @@ static void get_manufacturing_desc (struct edgeport_serial *edge_serial)
(__u8 *)(&edge_serial->manuf_descriptor)); (__u8 *)(&edge_serial->manuf_descriptor));
if (response < 1) { if (response < 1) {
dev_err(edge_serial->serial->dev->dev, "error in getting manufacturer descriptor\n"); dev_err(&edge_serial->serial->dev->dev, "error in getting manufacturer descriptor\n");
} else { } else {
char string[30]; char string[30];
dbg("**Manufacturer Descriptor"); dbg("**Manufacturer Descriptor");
...@@ -2877,7 +2877,7 @@ static void get_boot_desc (struct edgeport_serial *edge_serial) ...@@ -2877,7 +2877,7 @@ static void get_boot_desc (struct edgeport_serial *edge_serial)
(__u8 *)(&edge_serial->boot_descriptor)); (__u8 *)(&edge_serial->boot_descriptor));
if (response < 1) { if (response < 1) {
dev_err(edge_serial->serial->dev->dev, "error in getting boot descriptor\n"); dev_err(&edge_serial->serial->dev->dev, "error in getting boot descriptor\n");
} else { } else {
dbg("**Boot Descriptor:"); dbg("**Boot Descriptor:");
dbg(" BootCodeLength: %d", edge_serial->boot_descriptor.BootCodeLength); dbg(" BootCodeLength: %d", edge_serial->boot_descriptor.BootCodeLength);
...@@ -2938,7 +2938,7 @@ static void load_application_firmware (struct edgeport_serial *edge_serial) ...@@ -2938,7 +2938,7 @@ static void load_application_firmware (struct edgeport_serial *edge_serial)
record = (struct edge_firmware_image_record *)firmware; record = (struct edge_firmware_image_record *)firmware;
response = sram_write (edge_serial->serial, record->ExtAddr, record->Addr, record->Len, &record->Data[0]); response = sram_write (edge_serial->serial, record->ExtAddr, record->Addr, record->Len, &record->Data[0]);
if (response < 0) { if (response < 0) {
dev_err(edge_serial->serial->dev->dev, "sram_write failed (%x, %x, %d)\n", record->ExtAddr, record->Addr, record->Len); dev_err(&edge_serial->serial->dev->dev, "sram_write failed (%x, %x, %d)\n", record->ExtAddr, record->Addr, record->Len);
break; break;
} }
firmware += sizeof (struct edge_firmware_image_record) + record->Len; firmware += sizeof (struct edge_firmware_image_record) + record->Len;
...@@ -2974,7 +2974,7 @@ static int edge_startup (struct usb_serial *serial) ...@@ -2974,7 +2974,7 @@ static int edge_startup (struct usb_serial *serial)
/* create our private serial structure */ /* create our private serial structure */
edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL);
if (edge_serial == NULL) { if (edge_serial == NULL) {
dev_err(serial->dev->dev, "%s - Out of memory", __FUNCTION__); dev_err(&serial->dev->dev, "%s - Out of memory", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
memset (edge_serial, 0, sizeof(struct edgeport_serial)); memset (edge_serial, 0, sizeof(struct edgeport_serial));
...@@ -2988,7 +2988,7 @@ static int edge_startup (struct usb_serial *serial) ...@@ -2988,7 +2988,7 @@ static int edge_startup (struct usb_serial *serial)
get_string(dev, dev->descriptor.iProduct, &edge_serial->name[i]); get_string(dev, dev->descriptor.iProduct, &edge_serial->name[i]);
dev_info(serial->dev->dev, "%s detected\n", edge_serial->name); dev_info(&serial->dev->dev, "%s detected\n", edge_serial->name);
/* get the manufacturing descriptor for this device */ /* get the manufacturing descriptor for this device */
get_manufacturing_desc (edge_serial); get_manufacturing_desc (edge_serial);
...@@ -3030,7 +3030,7 @@ static int edge_startup (struct usb_serial *serial) ...@@ -3030,7 +3030,7 @@ static int edge_startup (struct usb_serial *serial)
for (i = 0; i < serial->num_ports; ++i) { for (i = 0; i < serial->num_ports; ++i) {
edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL); edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL);
if (edge_port == NULL) { if (edge_port == NULL) {
dev_err(serial->dev->dev, "%s - Out of memory", __FUNCTION__); dev_err(&serial->dev->dev, "%s - Out of memory", __FUNCTION__);
usb_set_serial_data(serial, NULL); usb_set_serial_data(serial, NULL);
kfree(edge_serial); kfree(edge_serial);
return -ENOMEM; return -ENOMEM;
......
This diff is collapsed.
...@@ -243,7 +243,7 @@ static int ir_startup (struct usb_serial *serial) ...@@ -243,7 +243,7 @@ static int ir_startup (struct usb_serial *serial)
irda_desc = irda_usb_find_class_desc (serial->dev, 0); irda_desc = irda_usb_find_class_desc (serial->dev, 0);
if (irda_desc == NULL) { if (irda_desc == NULL) {
dev_err (serial->dev->dev, "IRDA class descriptor not found, device not bound\n"); dev_err (&serial->dev->dev, "IRDA class descriptor not found, device not bound\n");
return -ENODEV; return -ENODEV;
} }
...@@ -291,7 +291,7 @@ static int ir_open (struct usb_serial_port *port, struct file *filp) ...@@ -291,7 +291,7 @@ static int ir_open (struct usb_serial_port *port, struct file *filp)
/* override the default buffer sizes */ /* override the default buffer sizes */
buffer = kmalloc (buffer_size, GFP_KERNEL); buffer = kmalloc (buffer_size, GFP_KERNEL);
if (!buffer) { if (!buffer) {
dev_err (port->dev, "%s - out of memory.\n", __FUNCTION__); dev_err (&port->dev, "%s - out of memory.\n", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
kfree (port->read_urb->transfer_buffer); kfree (port->read_urb->transfer_buffer);
...@@ -300,7 +300,7 @@ static int ir_open (struct usb_serial_port *port, struct file *filp) ...@@ -300,7 +300,7 @@ static int ir_open (struct usb_serial_port *port, struct file *filp)
buffer = kmalloc (buffer_size, GFP_KERNEL); buffer = kmalloc (buffer_size, GFP_KERNEL);
if (!buffer) { if (!buffer) {
dev_err (port->dev, "%s - out of memory.\n", __FUNCTION__); dev_err (&port->dev, "%s - out of memory.\n", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
} }
kfree (port->write_urb->transfer_buffer); kfree (port->write_urb->transfer_buffer);
...@@ -320,7 +320,7 @@ static int ir_open (struct usb_serial_port *port, struct file *filp) ...@@ -320,7 +320,7 @@ static int ir_open (struct usb_serial_port *port, struct file *filp)
port); port);
result = usb_submit_urb(port->read_urb, GFP_KERNEL); result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) 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", __FUNCTION__, result);
return result; return result;
} }
...@@ -353,7 +353,7 @@ static int ir_write (struct usb_serial_port *port, int from_user, const unsigned ...@@ -353,7 +353,7 @@ static int ir_write (struct usb_serial_port *port, int from_user, const unsigned
dbg("%s - port = %d, count = %d", __FUNCTION__, port->number, count); dbg("%s - port = %d, count = %d", __FUNCTION__, port->number, count);
if (!port->tty) { if (!port->tty) {
dev_err (port->dev, "%s - no tty???\n", __FUNCTION__); dev_err (&port->dev, "%s - no tty???\n", __FUNCTION__);
return 0; return 0;
} }
...@@ -399,7 +399,7 @@ static int ir_write (struct usb_serial_port *port, int from_user, const unsigned ...@@ -399,7 +399,7 @@ static int ir_write (struct usb_serial_port *port, int from_user, const unsigned
result = usb_submit_urb (port->write_urb, GFP_ATOMIC); result = usb_submit_urb (port->write_urb, GFP_ATOMIC);
if (result) 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", __FUNCTION__, result);
else else
result = transfer_size; result = transfer_size;
...@@ -504,7 +504,7 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -504,7 +504,7 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
dev_err(port->dev, "%s - failed resubmitting read urb, error %d\n", dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n",
__FUNCTION__, result); __FUNCTION__, result);
break ; break ;
...@@ -599,7 +599,7 @@ static void ir_set_termios (struct usb_serial_port *port, struct termios *old_te ...@@ -599,7 +599,7 @@ static void ir_set_termios (struct usb_serial_port *port, struct termios *old_te
result = usb_submit_urb (port->write_urb, GFP_KERNEL); result = usb_submit_urb (port->write_urb, GFP_KERNEL);
if (result) 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", __FUNCTION__, result);
} }
return; return;
} }
......
...@@ -1035,7 +1035,7 @@ static int keyspan_fake_startup (struct usb_serial *serial) ...@@ -1035,7 +1035,7 @@ static int keyspan_fake_startup (struct usb_serial *serial)
} }
if (record == NULL) { if (record == NULL) {
dev_err(serial->dev->dev, "Required keyspan firmware image (%s) unavailable.\n", fw_name); dev_err(&serial->dev->dev, "Required keyspan firmware image (%s) unavailable.\n", fw_name);
return(1); return(1);
} }
...@@ -1049,7 +1049,7 @@ static int keyspan_fake_startup (struct usb_serial *serial) ...@@ -1049,7 +1049,7 @@ static int keyspan_fake_startup (struct usb_serial *serial)
(unsigned char *)record->data, (unsigned char *)record->data,
record->data_size, 0xa0); record->data_size, 0xa0);
if (response < 0) { if (response < 0) {
dev_err(serial->dev->dev, "ezusb_writememory failed for Keyspan" dev_err(&serial->dev->dev, "ezusb_writememory failed for Keyspan"
"firmware (%d %04X %p %d)\n", "firmware (%d %04X %p %d)\n",
response, response,
record->address, record->data, record->data_size); record->address, record->data, record->data_size);
...@@ -1847,7 +1847,7 @@ static int keyspan_startup (struct usb_serial *serial) ...@@ -1847,7 +1847,7 @@ static int keyspan_startup (struct usb_serial *serial)
if (d_details->product_id == serial->dev->descriptor.idProduct) if (d_details->product_id == serial->dev->descriptor.idProduct)
break; break;
if (d_details == NULL) { if (d_details == NULL) {
dev_err(serial->dev->dev, "%s - unknown product id %x\n", __FUNCTION__, serial->dev->descriptor.idProduct); dev_err(&serial->dev->dev, "%s - unknown product id %x\n", __FUNCTION__, serial->dev->descriptor.idProduct);
return 1; return 1;
} }
......
...@@ -204,7 +204,7 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns ...@@ -204,7 +204,7 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const uns
port->write_urb->dev = port->serial->dev; port->write_urb->dev = port->serial->dev;
result = usb_submit_urb (port->write_urb, GFP_ATOMIC); result = usb_submit_urb (port->write_urb, GFP_ATOMIC);
if (result) 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", __FUNCTION__, result);
else else
result = count; result = count;
...@@ -246,7 +246,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -246,7 +246,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
buf = kmalloc (7, GFP_KERNEL); buf = kmalloc (7, GFP_KERNEL);
if (!buf) { if (!buf) {
dev_err(port->dev, "%s - out of memory.\n", __FUNCTION__); dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__);
return; return;
} }
memset (buf, 0x00, 0x07); memset (buf, 0x00, 0x07);
...@@ -294,7 +294,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol ...@@ -294,7 +294,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
case B230400: baud = 230400; break; case B230400: baud = 230400; break;
case B460800: baud = 460800; break; case B460800: baud = 460800; break;
default: default:
dev_err(port->dev, "pl2303 driver does not support the baudrate requested (fix it)\n"); dev_err(&port->dev, "pl2303 driver does not support the baudrate requested (fix it)\n");
break; break;
} }
dbg("%s - baud = %d", __FUNCTION__, baud); dbg("%s - baud = %d", __FUNCTION__, baud);
...@@ -411,7 +411,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp) ...@@ -411,7 +411,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
port->read_urb->dev = serial->dev; port->read_urb->dev = serial->dev;
result = usb_submit_urb (port->read_urb, GFP_KERNEL); result = usb_submit_urb (port->read_urb, GFP_KERNEL);
if (result) { 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", __FUNCTION__, result);
pl2303_close (port, NULL); pl2303_close (port, NULL);
return -EPROTO; return -EPROTO;
} }
...@@ -420,7 +420,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp) ...@@ -420,7 +420,7 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
port->interrupt_in_urb->dev = serial->dev; port->interrupt_in_urb->dev = serial->dev;
result = usb_submit_urb (port->interrupt_in_urb, GFP_KERNEL); result = usb_submit_urb (port->interrupt_in_urb, GFP_KERNEL);
if (result) { if (result) {
dev_err(port->dev, "%s - failed submitting interrupt urb, error %d\n", __FUNCTION__, result); dev_err(&port->dev, "%s - failed submitting interrupt urb, error %d\n", __FUNCTION__, result);
pl2303_close (port, NULL); pl2303_close (port, NULL);
return -EPROTO; return -EPROTO;
} }
...@@ -621,7 +621,7 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs) ...@@ -621,7 +621,7 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs)
exit: exit:
status = usb_submit_urb (urb, GFP_ATOMIC); status = usb_submit_urb (urb, GFP_ATOMIC);
if (status) if (status)
dev_err(urb->dev->dev, "%s - usb_submit_urb failed with result %d\n", dev_err(&urb->dev->dev, "%s - usb_submit_urb failed with result %d\n",
__FUNCTION__, status); __FUNCTION__, status);
} }
...@@ -658,7 +658,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -658,7 +658,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
urb->dev = serial->dev; urb->dev = serial->dev;
result = usb_submit_urb(urb, GFP_ATOMIC); result = usb_submit_urb(urb, GFP_ATOMIC);
if (result) if (result)
dev_err(urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); dev_err(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
return; return;
} }
dbg("%s - unable to handle the error, exiting.", __FUNCTION__); dbg("%s - unable to handle the error, exiting.", __FUNCTION__);
...@@ -683,7 +683,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -683,7 +683,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
urb->dev = serial->dev; urb->dev = serial->dev;
result = usb_submit_urb(urb, GFP_ATOMIC); result = usb_submit_urb(urb, GFP_ATOMIC);
if (result) if (result)
dev_err(urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); dev_err(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
} }
return; return;
...@@ -712,7 +712,7 @@ static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -712,7 +712,7 @@ static void pl2303_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
port->write_urb->dev = port->serial->dev; port->write_urb->dev = port->serial->dev;
result = usb_submit_urb (port->write_urb, GFP_ATOMIC); result = usb_submit_urb (port->write_urb, GFP_ATOMIC);
if (result) if (result)
dev_err(urb->dev->dev, "%s - failed resubmitting write urb, error %d\n", __FUNCTION__, result); dev_err(&urb->dev->dev, "%s - failed resubmitting write urb, error %d\n", __FUNCTION__, result);
return; return;
} }
......
...@@ -841,7 +841,7 @@ static struct usb_serial * create_serial (struct usb_device *dev, ...@@ -841,7 +841,7 @@ static struct usb_serial * create_serial (struct usb_device *dev,
serial = kmalloc (sizeof (*serial), GFP_KERNEL); serial = kmalloc (sizeof (*serial), GFP_KERNEL);
if (!serial) { if (!serial) {
dev_err(dev->dev, "%s - out of memory\n", __FUNCTION__); dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__);
return NULL; return NULL;
} }
memset (serial, 0, sizeof(*serial)); memset (serial, 0, sizeof(*serial));
...@@ -899,14 +899,14 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -899,14 +899,14 @@ int usb_serial_probe(struct usb_interface *interface,
serial = create_serial (dev, interface, type); serial = create_serial (dev, interface, type);
if (!serial) { if (!serial) {
dev_err(interface->dev, "%s - out of memory\n", __FUNCTION__); dev_err(&interface->dev, "%s - out of memory\n", __FUNCTION__);
return -ENODEV; return -ENODEV;
} }
/* if this device type has a probe function, call it */ /* if this device type has a probe function, call it */
if (type->probe) { if (type->probe) {
if (!try_module_get(type->owner)) { if (!try_module_get(type->owner)) {
dev_err(interface->dev, "module get failed, exiting\n"); dev_err(&interface->dev, "module get failed, exiting\n");
kfree (serial); kfree (serial);
return -EIO; return -EIO;
} }
...@@ -980,7 +980,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -980,7 +980,7 @@ int usb_serial_probe(struct usb_interface *interface,
* properly during a later invocation of usb_serial_probe * properly during a later invocation of usb_serial_probe
*/ */
if (num_bulk_in == 0 || num_bulk_out == 0) { if (num_bulk_in == 0 || num_bulk_out == 0) {
dev_info(interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n");
kfree (serial); kfree (serial);
return -ENODEV; return -ENODEV;
} }
...@@ -989,13 +989,13 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -989,13 +989,13 @@ int usb_serial_probe(struct usb_interface *interface,
#endif #endif
/* found all that we need */ /* found all that we need */
dev_info(interface->dev, "%s converter detected\n", type->name); dev_info(&interface->dev, "%s converter detected\n", type->name);
#ifdef CONFIG_USB_SERIAL_GENERIC #ifdef CONFIG_USB_SERIAL_GENERIC
if (type == &usb_serial_generic_device) { if (type == &usb_serial_generic_device) {
num_ports = num_bulk_out; num_ports = num_bulk_out;
if (num_ports == 0) { if (num_ports == 0) {
dev_err(interface->dev, "Generic device with no bulk out, not allowed.\n"); dev_err(&interface->dev, "Generic device with no bulk out, not allowed.\n");
kfree (serial); kfree (serial);
return -EIO; return -EIO;
} }
...@@ -1005,7 +1005,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1005,7 +1005,7 @@ int usb_serial_probe(struct usb_interface *interface,
/* if this device type has a calc_num_ports function, call it */ /* if this device type has a calc_num_ports function, call it */
if (type->calc_num_ports) { if (type->calc_num_ports) {
if (!try_module_get(type->owner)) { if (!try_module_get(type->owner)) {
dev_err(interface->dev, "module get failed, exiting\n"); dev_err(&interface->dev, "module get failed, exiting\n");
kfree (serial); kfree (serial);
return -EIO; return -EIO;
} }
...@@ -1017,7 +1017,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1017,7 +1017,7 @@ int usb_serial_probe(struct usb_interface *interface,
} }
if (get_free_serial (serial, num_ports, &minor) == NULL) { if (get_free_serial (serial, num_ports, &minor) == NULL) {
dev_err(interface->dev, "No more free serial devices\n"); dev_err(&interface->dev, "No more free serial devices\n");
kfree (serial); kfree (serial);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1034,14 +1034,14 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1034,14 +1034,14 @@ int usb_serial_probe(struct usb_interface *interface,
port = &serial->port[i]; port = &serial->port[i];
port->read_urb = usb_alloc_urb (0, GFP_KERNEL); port->read_urb = usb_alloc_urb (0, GFP_KERNEL);
if (!port->read_urb) { if (!port->read_urb) {
dev_err(interface->dev, "No free urbs available\n"); dev_err(&interface->dev, "No free urbs available\n");
goto probe_error; goto probe_error;
} }
buffer_size = endpoint->wMaxPacketSize; buffer_size = endpoint->wMaxPacketSize;
port->bulk_in_endpointAddress = endpoint->bEndpointAddress; port->bulk_in_endpointAddress = endpoint->bEndpointAddress;
port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL); port->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
if (!port->bulk_in_buffer) { if (!port->bulk_in_buffer) {
dev_err(interface->dev, "Couldn't allocate bulk_in_buffer\n"); dev_err(&interface->dev, "Couldn't allocate bulk_in_buffer\n");
goto probe_error; goto probe_error;
} }
usb_fill_bulk_urb (port->read_urb, dev, usb_fill_bulk_urb (port->read_urb, dev,
...@@ -1059,7 +1059,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1059,7 +1059,7 @@ int usb_serial_probe(struct usb_interface *interface,
port = &serial->port[i]; port = &serial->port[i];
port->write_urb = usb_alloc_urb(0, GFP_KERNEL); port->write_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!port->write_urb) { if (!port->write_urb) {
dev_err(interface->dev, "No free urbs available\n"); dev_err(&interface->dev, "No free urbs available\n");
goto probe_error; goto probe_error;
} }
buffer_size = endpoint->wMaxPacketSize; buffer_size = endpoint->wMaxPacketSize;
...@@ -1067,7 +1067,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1067,7 +1067,7 @@ int usb_serial_probe(struct usb_interface *interface,
port->bulk_out_endpointAddress = endpoint->bEndpointAddress; port->bulk_out_endpointAddress = endpoint->bEndpointAddress;
port->bulk_out_buffer = kmalloc (buffer_size, GFP_KERNEL); port->bulk_out_buffer = kmalloc (buffer_size, GFP_KERNEL);
if (!port->bulk_out_buffer) { if (!port->bulk_out_buffer) {
dev_err(interface->dev, "Couldn't allocate bulk_out_buffer\n"); dev_err(&interface->dev, "Couldn't allocate bulk_out_buffer\n");
goto probe_error; goto probe_error;
} }
usb_fill_bulk_urb (port->write_urb, dev, usb_fill_bulk_urb (port->write_urb, dev,
...@@ -1085,14 +1085,14 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1085,14 +1085,14 @@ int usb_serial_probe(struct usb_interface *interface,
port = &serial->port[i]; port = &serial->port[i];
port->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); port->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!port->interrupt_in_urb) { if (!port->interrupt_in_urb) {
dev_err(interface->dev, "No free urbs available\n"); dev_err(&interface->dev, "No free urbs available\n");
goto probe_error; goto probe_error;
} }
buffer_size = endpoint->wMaxPacketSize; buffer_size = endpoint->wMaxPacketSize;
port->interrupt_in_endpointAddress = endpoint->bEndpointAddress; port->interrupt_in_endpointAddress = endpoint->bEndpointAddress;
port->interrupt_in_buffer = kmalloc (buffer_size, GFP_KERNEL); port->interrupt_in_buffer = kmalloc (buffer_size, GFP_KERNEL);
if (!port->interrupt_in_buffer) { if (!port->interrupt_in_buffer) {
dev_err(interface->dev, "Couldn't allocate interrupt_in_buffer\n"); dev_err(&interface->dev, "Couldn't allocate interrupt_in_buffer\n");
goto probe_error; goto probe_error;
} }
usb_fill_int_urb (port->interrupt_in_urb, dev, usb_fill_int_urb (port->interrupt_in_urb, dev,
...@@ -1121,7 +1121,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1121,7 +1121,7 @@ int usb_serial_probe(struct usb_interface *interface,
/* if this device type has an attach function, call it */ /* if this device type has an attach function, call it */
if (type->attach) { if (type->attach) {
if (!try_module_get(type->owner)) { if (!try_module_get(type->owner)) {
dev_err(interface->dev, "module get failed, exiting\n"); dev_err(&interface->dev, "module get failed, exiting\n");
goto probe_error; goto probe_error;
} }
retval = type->attach (serial); retval = type->attach (serial);
...@@ -1253,7 +1253,7 @@ void usb_serial_disconnect(struct usb_interface *interface) ...@@ -1253,7 +1253,7 @@ void usb_serial_disconnect(struct usb_interface *interface)
/* free up any memory that we allocated */ /* free up any memory that we allocated */
kfree (serial); kfree (serial);
} }
dev_info(*dev, "device disconnected\n"); dev_info(dev, "device disconnected\n");
} }
......
...@@ -303,7 +303,7 @@ static int visor_open (struct usb_serial_port *port, struct file *filp) ...@@ -303,7 +303,7 @@ static int visor_open (struct usb_serial_port *port, struct file *filp)
if (!port->read_urb) { if (!port->read_urb) {
/* this is needed for some brain dead Sony devices */ /* this is needed for some brain dead Sony devices */
dev_err(port->dev, "Device lied about number of ports, please use a lower one.\n"); dev_err(&port->dev, "Device lied about number of ports, please use a lower one.\n");
return -ENODEV; return -ENODEV;
} }
...@@ -327,7 +327,7 @@ static int visor_open (struct usb_serial_port *port, struct file *filp) ...@@ -327,7 +327,7 @@ static int visor_open (struct usb_serial_port *port, struct file *filp)
visor_read_bulk_callback, port); visor_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_KERNEL); result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result) { if (result) {
dev_err(port->dev, "%s - failed submitting read urb, error %d\n", dev_err(&port->dev, "%s - failed submitting read urb, error %d\n",
__FUNCTION__, result); __FUNCTION__, result);
goto exit; goto exit;
} }
...@@ -336,7 +336,7 @@ static int visor_open (struct usb_serial_port *port, struct file *filp) ...@@ -336,7 +336,7 @@ static int visor_open (struct usb_serial_port *port, struct file *filp)
dbg("%s - adding interrupt input for treo", __FUNCTION__); dbg("%s - adding interrupt input for treo", __FUNCTION__);
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result) if (result)
dev_err(port->dev, "%s - failed submitting interrupt urb, error %d\n", dev_err(&port->dev, "%s - failed submitting interrupt urb, error %d\n",
__FUNCTION__, result); __FUNCTION__, result);
} }
exit: exit:
...@@ -363,7 +363,7 @@ static void visor_close (struct usb_serial_port *port, struct file * filp) ...@@ -363,7 +363,7 @@ static void visor_close (struct usb_serial_port *port, struct file * filp)
* device is still here */ * device is still here */
transfer_buffer = kmalloc (0x12, GFP_KERNEL); transfer_buffer = kmalloc (0x12, GFP_KERNEL);
if (!transfer_buffer) { if (!transfer_buffer) {
dev_err(port->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 0x12); dev_err(&port->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 0x12);
} else { } else {
/* send a shutdown message to the device */ /* send a shutdown message to the device */
usb_control_msg (serial->dev, usb_control_msg (serial->dev,
...@@ -380,7 +380,7 @@ static void visor_close (struct usb_serial_port *port, struct file * filp) ...@@ -380,7 +380,7 @@ static void visor_close (struct usb_serial_port *port, struct file * filp)
usb_unlink_urb (port->interrupt_in_urb); usb_unlink_urb (port->interrupt_in_urb);
} }
/* Uncomment the following line if you want to see some statistics in your syslog */ /* Uncomment the following line if you want to see some statistics in your syslog */
/* dev_info (port->dev, "Bytes In = %d Bytes Out = %d\n", bytes_in, bytes_out); */ /* dev_info (&port->dev, "Bytes In = %d Bytes Out = %d\n", bytes_in, bytes_out); */
} }
...@@ -395,13 +395,13 @@ static int visor_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -395,13 +395,13 @@ static int visor_write (struct usb_serial_port *port, int from_user, const unsig
buffer = kmalloc (count, GFP_ATOMIC); buffer = kmalloc (count, GFP_ATOMIC);
if (!buffer) { if (!buffer) {
dev_err(port->dev, "out of memory\n"); dev_err(&port->dev, "out of memory\n");
return -ENOMEM; return -ENOMEM;
} }
urb = usb_alloc_urb(0, GFP_ATOMIC); urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) { if (!urb) {
dev_err(port->dev, "no more free urbs\n"); dev_err(&port->dev, "no more free urbs\n");
kfree (buffer); kfree (buffer);
return -ENOMEM; return -ENOMEM;
} }
...@@ -427,7 +427,7 @@ static int visor_write (struct usb_serial_port *port, int from_user, const unsig ...@@ -427,7 +427,7 @@ static int visor_write (struct usb_serial_port *port, int from_user, const unsig
/* send it down the pipe */ /* send it down the pipe */
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status) { if (status) {
dev_err(port->dev, "%s - usb_submit_urb(write bulk) failed with status = %d\n", dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed with status = %d\n",
__FUNCTION__, status); __FUNCTION__, status);
count = status; count = status;
} else { } else {
...@@ -539,7 +539,7 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs) ...@@ -539,7 +539,7 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
visor_read_bulk_callback, port); visor_read_bulk_callback, port);
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
dev_err(port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
return; return;
} }
...@@ -577,7 +577,7 @@ static void visor_read_int_callback (struct urb *urb, struct pt_regs *regs) ...@@ -577,7 +577,7 @@ static void visor_read_int_callback (struct urb *urb, struct pt_regs *regs)
exit: exit:
result = usb_submit_urb (urb, GFP_ATOMIC); result = usb_submit_urb (urb, GFP_ATOMIC);
if (result) if (result)
dev_err(urb->dev->dev, "%s - Error %d submitting interrupt urb\n", dev_err(&urb->dev->dev, "%s - Error %d submitting interrupt urb\n",
__FUNCTION__, result); __FUNCTION__, result);
} }
...@@ -597,7 +597,7 @@ static void visor_unthrottle (struct usb_serial_port *port) ...@@ -597,7 +597,7 @@ static void visor_unthrottle (struct usb_serial_port *port)
port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) 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", __FUNCTION__, result);
} }
static int visor_probe (struct usb_serial *serial) static int visor_probe (struct usb_serial *serial)
...@@ -609,7 +609,7 @@ static int visor_probe (struct usb_serial *serial) ...@@ -609,7 +609,7 @@ static int visor_probe (struct usb_serial *serial)
unsigned char *transfer_buffer = kmalloc (256, GFP_KERNEL); unsigned char *transfer_buffer = kmalloc (256, GFP_KERNEL);
if (!transfer_buffer) { if (!transfer_buffer) {
dev_err(*dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 256); dev_err(dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 256);
return -ENOMEM; return -ENOMEM;
} }
...@@ -622,14 +622,14 @@ static int visor_probe (struct usb_serial *serial) ...@@ -622,14 +622,14 @@ static int visor_probe (struct usb_serial *serial)
response = usb_control_msg (serial->dev, usb_rcvctrlpipe(serial->dev, 0), VISOR_GET_CONNECTION_INFORMATION, response = usb_control_msg (serial->dev, usb_rcvctrlpipe(serial->dev, 0), VISOR_GET_CONNECTION_INFORMATION,
0xc2, 0x0000, 0x0000, transfer_buffer, 0x12, 300); 0xc2, 0x0000, 0x0000, transfer_buffer, 0x12, 300);
if (response < 0) { if (response < 0) {
dev_err(*dev, "%s - error getting connection information\n", __FUNCTION__); dev_err(dev, "%s - error getting connection information\n", __FUNCTION__);
} else { } else {
struct visor_connection_info *connection_info = (struct visor_connection_info *)transfer_buffer; struct visor_connection_info *connection_info = (struct visor_connection_info *)transfer_buffer;
char *string; char *string;
le16_to_cpus(&connection_info->num_ports); le16_to_cpus(&connection_info->num_ports);
num_ports = connection_info->num_ports; num_ports = connection_info->num_ports;
dev_info(*dev, "%s: Number of ports: %d\n", serial->type->name, connection_info->num_ports); dev_info(dev, "%s: Number of ports: %d\n", serial->type->name, connection_info->num_ports);
for (i = 0; i < num_ports; ++i) { for (i = 0; i < num_ports; ++i) {
switch (connection_info->connections[i].port_function_id) { switch (connection_info->connections[i].port_function_id) {
case VISOR_FUNCTION_GENERIC: case VISOR_FUNCTION_GENERIC:
...@@ -651,7 +651,7 @@ static int visor_probe (struct usb_serial *serial) ...@@ -651,7 +651,7 @@ static int visor_probe (struct usb_serial *serial)
string = "unknown"; string = "unknown";
break; break;
} }
dev_info(*dev, "%s: port %d, is for %s use\n", serial->type->name, dev_info(dev, "%s: port %d, is for %s use\n", serial->type->name,
connection_info->connections[i].port, string); connection_info->connections[i].port, string);
/* save off our num_ports info so that we can use it in the calc_num_ports call */ /* save off our num_ports info so that we can use it in the calc_num_ports call */
usb_set_serial_data(serial, (void *)(long)num_ports); usb_set_serial_data(serial, (void *)(long)num_ports);
...@@ -667,7 +667,7 @@ static int visor_probe (struct usb_serial *serial) ...@@ -667,7 +667,7 @@ static int visor_probe (struct usb_serial *serial)
0xc2, 0x0000, 0x0000, transfer_buffer, 0xc2, 0x0000, 0x0000, transfer_buffer,
0x14, 300); 0x14, 300);
if (response < 0) { if (response < 0) {
dev_err(*dev, "%s - error getting first unknown palm command\n", __FUNCTION__); dev_err(dev, "%s - error getting first unknown palm command\n", __FUNCTION__);
} else { } else {
usb_serial_debug_data (__FILE__, __FUNCTION__, 0x14, transfer_buffer); usb_serial_debug_data (__FILE__, __FUNCTION__, 0x14, transfer_buffer);
} }
...@@ -676,7 +676,7 @@ static int visor_probe (struct usb_serial *serial) ...@@ -676,7 +676,7 @@ static int visor_probe (struct usb_serial *serial)
0xc2, 0x0000, 0x0000, transfer_buffer, 0xc2, 0x0000, 0x0000, transfer_buffer,
0x14, 300); 0x14, 300);
if (response < 0) { if (response < 0) {
dev_err(*dev, "%s - error getting second unknown palm command\n", __FUNCTION__); dev_err(dev, "%s - error getting second unknown palm command\n", __FUNCTION__);
} else { } else {
usb_serial_debug_data (__FILE__, __FUNCTION__, 0x14, transfer_buffer); usb_serial_debug_data (__FILE__, __FUNCTION__, 0x14, transfer_buffer);
} }
...@@ -686,7 +686,7 @@ static int visor_probe (struct usb_serial *serial) ...@@ -686,7 +686,7 @@ static int visor_probe (struct usb_serial *serial)
response = usb_control_msg (serial->dev, usb_rcvctrlpipe(serial->dev, 0), VISOR_REQUEST_BYTES_AVAILABLE, response = usb_control_msg (serial->dev, usb_rcvctrlpipe(serial->dev, 0), VISOR_REQUEST_BYTES_AVAILABLE,
0xc2, 0x0000, 0x0005, transfer_buffer, 0x02, 300); 0xc2, 0x0000, 0x0005, transfer_buffer, 0x02, 300);
if (response < 0) { if (response < 0) {
dev_err(*dev, "%s - error getting bytes available request\n", __FUNCTION__); dev_err(dev, "%s - error getting bytes available request\n", __FUNCTION__);
} }
kfree (transfer_buffer); kfree (transfer_buffer);
...@@ -722,11 +722,11 @@ static int clie_3_5_startup (struct usb_serial *serial) ...@@ -722,11 +722,11 @@ static int clie_3_5_startup (struct usb_serial *serial)
USB_REQ_GET_CONFIGURATION, USB_DIR_IN, USB_REQ_GET_CONFIGURATION, USB_DIR_IN,
0, 0, &data, 1, HZ * 3); 0, 0, &data, 1, HZ * 3);
if (result < 0) { if (result < 0) {
dev_err(*dev, "%s: get config number failed: %d\n", __FUNCTION__, result); dev_err(dev, "%s: get config number failed: %d\n", __FUNCTION__, result);
return result; return result;
} }
if (result != 1) { if (result != 1) {
dev_err(*dev, "%s: get config number bad return length: %d\n", __FUNCTION__, result); dev_err(dev, "%s: get config number bad return length: %d\n", __FUNCTION__, result);
return -EIO; return -EIO;
} }
...@@ -736,11 +736,11 @@ static int clie_3_5_startup (struct usb_serial *serial) ...@@ -736,11 +736,11 @@ static int clie_3_5_startup (struct usb_serial *serial)
USB_DIR_IN | USB_RECIP_INTERFACE, USB_DIR_IN | USB_RECIP_INTERFACE,
0, 0, &data, 1, HZ * 3); 0, 0, &data, 1, HZ * 3);
if (result < 0) { if (result < 0) {
dev_err(*dev, "%s: get interface number failed: %d\n", __FUNCTION__, result); dev_err(dev, "%s: get interface number failed: %d\n", __FUNCTION__, result);
return result; return result;
} }
if (result != 1) { if (result != 1) {
dev_err(*dev, "%s: get interface number bad return length: %d\n", __FUNCTION__, result); dev_err(dev, "%s: get interface number bad return length: %d\n", __FUNCTION__, result);
return -EIO; return -EIO;
} }
......
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