Commit 5acc6e40 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

usb: ftdi-elan: Coalesce formats

Make it easier to find formats.

Realign arguments around these changes.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8dae693c
...@@ -545,11 +545,10 @@ static void ftdi_elan_status_work(struct work_struct *work) ...@@ -545,11 +545,10 @@ static void ftdi_elan_status_work(struct work_struct *work)
ftdi->stuck_status = 0; ftdi->stuck_status = 0;
ftdi->synchronized = 0; ftdi->synchronized = 0;
} else if ((ftdi->stuck_status++ % 60) == 1) { } else if ((ftdi->stuck_status++ % 60) == 1) {
dev_err(&ftdi->udev->dev, "WRONG type of card inserted " dev_err(&ftdi->udev->dev, "WRONG type of card inserted - please remove\n");
"- please remove\n");
} else } else
dev_err(&ftdi->udev->dev, "WRONG type of card inserted " dev_err(&ftdi->udev->dev, "WRONG type of card inserted - checked %d times\n",
"- checked %d times\n", ftdi->stuck_status); ftdi->stuck_status);
work_delay_in_msec = 100; work_delay_in_msec = 100;
} else if (ftdi->enumerated == 0) { } else if (ftdi->enumerated == 0) {
if (ftdi_elan_enumeratePCI(ftdi) == 0) { if (ftdi_elan_enumeratePCI(ftdi) == 0) {
...@@ -562,8 +561,7 @@ static void ftdi_elan_status_work(struct work_struct *work) ...@@ -562,8 +561,7 @@ static void ftdi_elan_status_work(struct work_struct *work)
ftdi->initialized = 1; ftdi->initialized = 1;
work_delay_in_msec = 500; work_delay_in_msec = 500;
} else { } else {
dev_err(&ftdi->udev->dev, "initialized failed - trying " dev_err(&ftdi->udev->dev, "initialized failed - trying again in 10 seconds\n");
"again in 10 seconds\n");
work_delay_in_msec = 1 *1000; work_delay_in_msec = 1 *1000;
} }
} else if (ftdi->registered == 0) { } else if (ftdi->registered == 0) {
...@@ -578,9 +576,7 @@ static void ftdi_elan_status_work(struct work_struct *work) ...@@ -578,9 +576,7 @@ static void ftdi_elan_status_work(struct work_struct *work)
work_delay_in_msec = 250; work_delay_in_msec = 250;
} else if (ftdi->controlreg & 0x00400000) { } else if (ftdi->controlreg & 0x00400000) {
if (ftdi->gone_away > 0) { if (ftdi->gone_away > 0) {
dev_err(&ftdi->udev->dev, "PCI device eject con" dev_err(&ftdi->udev->dev, "PCI device eject confirmed platform_dev.dev.parent=%p platform_dev.dev=%p\n",
"firmed platform_dev.dev.parent=%p plat"
"form_dev.dev=%p\n",
ftdi->platform_dev.dev.parent, ftdi->platform_dev.dev.parent,
&ftdi->platform_dev.dev); &ftdi->platform_dev.dev);
platform_device_unregister(&ftdi->platform_dev); platform_device_unregister(&ftdi->platform_dev);
...@@ -788,17 +784,15 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi) ...@@ -788,17 +784,15 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
total_size = ftdi_elan_total_command_size(ftdi, command_size); total_size = ftdi_elan_total_command_size(ftdi, command_size);
urb = usb_alloc_urb(0, GFP_KERNEL); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) { if (!urb) {
dev_err(&ftdi->udev->dev, "could not get a urb to write %d comm" dev_err(&ftdi->udev->dev, "could not get a urb to write %d commands totaling %d bytes to the Uxxx\n",
"ands totaling %d bytes to the Uxxx\n", command_size, command_size, total_size);
total_size);
return -ENOMEM; return -ENOMEM;
} }
buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL, buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
&urb->transfer_dma); &urb->transfer_dma);
if (!buf) { if (!buf) {
dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c" dev_err(&ftdi->udev->dev, "could not get a buffer to write %d commands totaling %d bytes to the Uxxx\n",
"ommands totaling %d bytes to the Uxxx\n", command_size, command_size, total_size);
total_size);
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -824,9 +818,8 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi) ...@@ -824,9 +818,8 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
} }
retval = usb_submit_urb(urb, GFP_KERNEL); retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) { if (retval) {
dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write " dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write %d commands totaling %d bytes to the Uxxx\n",
"%d commands totaling %d bytes to the Uxxx\n", retval, retval, urb, command_size, total_size);
urb, command_size, total_size);
usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma); usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma);
usb_free_urb(urb); usb_free_urb(urb);
return retval; return retval;
...@@ -980,8 +973,7 @@ read:{ ...@@ -980,8 +973,7 @@ read:{
goto have; goto have;
} else if (retval == -ETIMEDOUT) { } else if (retval == -ETIMEDOUT) {
if (retry_on_timeout-- > 0) { if (retry_on_timeout-- > 0) {
dev_err(&ftdi->udev->dev, "TIMED OUT with packe" dev_err(&ftdi->udev->dev, "TIMED OUT with packet_bytes = %d with total %d bytes%s\n",
"t_bytes = %d with total %d bytes%s\n",
packet_bytes, bytes_read, diag); packet_bytes, bytes_read, diag);
goto more; goto more;
} else if (bytes_read > 0) { } else if (bytes_read > 0) {
...@@ -989,20 +981,17 @@ read:{ ...@@ -989,20 +981,17 @@ read:{
bytes_read, diag); bytes_read, diag);
return -ENOMEM; return -ENOMEM;
} else { } else {
dev_err(&ftdi->udev->dev, "TIMED OUT with packe" dev_err(&ftdi->udev->dev, "TIMED OUT with packet_bytes = %d with total %d bytes%s\n",
"t_bytes = %d with total %d bytes%s\n",
packet_bytes, bytes_read, diag); packet_bytes, bytes_read, diag);
return -ENOMEM; return -ENOMEM;
} }
} else if (retval == -EILSEQ) { } else if (retval == -EILSEQ) {
dev_err(&ftdi->udev->dev, "error = %d with packet_bytes" dev_err(&ftdi->udev->dev, "error = %d with packet_bytes = %d with total %d bytes%s\n",
" = %d with total %d bytes%s\n", retval, retval, packet_bytes, bytes_read, diag);
packet_bytes, bytes_read, diag);
return retval; return retval;
} else if (retval) { } else if (retval) {
dev_err(&ftdi->udev->dev, "error = %d with packet_bytes" dev_err(&ftdi->udev->dev, "error = %d with packet_bytes = %d with total %d bytes%s\n",
" = %d with total %d bytes%s\n", retval, retval, packet_bytes, bytes_read, diag);
packet_bytes, bytes_read, diag);
return retval; return retval;
} else if (packet_bytes == 2) { } else if (packet_bytes == 2) {
unsigned char s0 = ftdi->bulk_in_buffer[0]; unsigned char s0 = ftdi->bulk_in_buffer[0];
...@@ -1099,8 +1088,8 @@ have:if (ftdi->bulk_in_left > 0) { ...@@ -1099,8 +1088,8 @@ have:if (ftdi->bulk_in_left > 0) {
} else if (buscmd == 0x06) { } else if (buscmd == 0x06) {
} else if (buscmd == 0x0A) { } else if (buscmd == 0x0A) {
} else } else
dev_err(&ftdi->udev->dev, "Uxxx unknown(%0X) va" dev_err(&ftdi->udev->dev, "Uxxx unknown(%0X) value = %08X\n",
"lue = %08X\n", buscmd, data); buscmd, data);
goto have; goto have;
} else { } else {
if ((ftdi->response[0] & 0x80) == 0x00) { if ((ftdi->response[0] & 0x80) == 0x00) {
...@@ -1909,35 +1898,31 @@ more:{ ...@@ -1909,35 +1898,31 @@ more:{
} else if (retry_on_status-- > 0) { } else if (retry_on_status-- > 0) {
goto more; goto more;
} else { } else {
dev_err(&ftdi->udev->dev, "STATUS ERROR retry l" dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
"imit reached\n");
return -EFAULT; return -EFAULT;
} }
} else if (packet_bytes > 0) { } else if (packet_bytes > 0) {
char b1 = ftdi->bulk_in_buffer[0]; char b1 = ftdi->bulk_in_buffer[0];
dev_err(&ftdi->udev->dev, "only one byte flushed from F" dev_err(&ftdi->udev->dev, "only one byte flushed from FTDI = %02X\n",
"TDI = %02X\n", b1); b1);
if (retry_on_status-- > 0) { if (retry_on_status-- > 0) {
goto more; goto more;
} else { } else {
dev_err(&ftdi->udev->dev, "STATUS ERROR retry l" dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
"imit reached\n");
return -EFAULT; return -EFAULT;
} }
} else if (retval == -ETIMEDOUT) { } else if (retval == -ETIMEDOUT) {
if (retry_on_timeout-- > 0) { if (retry_on_timeout-- > 0) {
goto more; goto more;
} else { } else {
dev_err(&ftdi->udev->dev, "TIMED OUT retry limi" dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
"t reached\n");
return -ENOMEM; return -ENOMEM;
} }
} else if (retval == 0) { } else if (retval == 0) {
if (retry_on_empty-- > 0) { if (retry_on_empty-- > 0) {
goto more; goto more;
} else { } else {
dev_err(&ftdi->udev->dev, "empty packet retry l" dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
"imit reached\n");
return -ENOMEM; return -ENOMEM;
} }
} else { } else {
...@@ -1962,14 +1947,12 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi) ...@@ -1962,14 +1947,12 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
int i = 0; int i = 0;
urb = usb_alloc_urb(0, GFP_KERNEL); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) { if (!urb) {
dev_err(&ftdi->udev->dev, "could not alloc a urb for flush sequ" dev_err(&ftdi->udev->dev, "could not alloc a urb for flush sequence\n");
"ence\n");
return -ENOMEM; return -ENOMEM;
} }
buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
if (!buf) { if (!buf) {
dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq" dev_err(&ftdi->udev->dev, "could not get a buffer for flush sequence\n");
"uence\n");
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1981,8 +1964,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi) ...@@ -1981,8 +1964,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
retval = usb_submit_urb(urb, GFP_KERNEL); retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) { if (retval) {
dev_err(&ftdi->udev->dev, "failed to submit urb containing the " dev_err(&ftdi->udev->dev, "failed to submit urb containing the flush sequence\n");
"flush sequence\n");
usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma); usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
...@@ -2005,14 +1987,12 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi) ...@@ -2005,14 +1987,12 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
int i = 0; int i = 0;
urb = usb_alloc_urb(0, GFP_KERNEL); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) { if (!urb) {
dev_err(&ftdi->udev->dev, "could not get a urb for the reset se" dev_err(&ftdi->udev->dev, "could not get a urb for the reset sequence\n");
"quence\n");
return -ENOMEM; return -ENOMEM;
} }
buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
if (!buf) { if (!buf) {
dev_err(&ftdi->udev->dev, "could not get a buffer for the reset" dev_err(&ftdi->udev->dev, "could not get a buffer for the reset sequence\n");
" sequence\n");
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2026,8 +2006,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi) ...@@ -2026,8 +2006,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
retval = usb_submit_urb(urb, GFP_KERNEL); retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) { if (retval) {
dev_err(&ftdi->udev->dev, "failed to submit urb containing the " dev_err(&ftdi->udev->dev, "failed to submit urb containing the reset sequence\n");
"reset sequence\n");
usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma); usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
...@@ -2095,8 +2074,7 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi) ...@@ -2095,8 +2074,7 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
} else if (read_stop-- > 0) { } else if (read_stop-- > 0) {
goto read; goto read;
} else { } else {
dev_err(&ftdi->udev->dev, "retr" dev_err(&ftdi->udev->dev, "retry limit reached\n");
"y limit reached\n");
continue; continue;
} }
} }
...@@ -2112,16 +2090,14 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi) ...@@ -2112,16 +2090,14 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
if (read_stop-- > 0) { if (read_stop-- > 0) {
goto read; goto read;
} else { } else {
dev_err(&ftdi->udev->dev, "retr" dev_err(&ftdi->udev->dev, "retry limit reached\n");
"y limit reached\n");
continue; continue;
} }
} else { } else {
if (read_stop-- > 0) { if (read_stop-- > 0) {
goto read; goto read;
} else { } else {
dev_err(&ftdi->udev->dev, "retr" dev_err(&ftdi->udev->dev, "retry limit reached\n");
"y limit reached\n");
continue; continue;
} }
} }
...@@ -2129,24 +2105,21 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi) ...@@ -2129,24 +2105,21 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
if (read_stop-- > 0) { if (read_stop-- > 0) {
goto read; goto read;
} else { } else {
dev_err(&ftdi->udev->dev, "retry limit " dev_err(&ftdi->udev->dev, "retry limit reached\n");
"reached\n");
continue; continue;
} }
} else if (retval == -ETIMEDOUT) { } else if (retval == -ETIMEDOUT) {
if (retry_on_timeout-- > 0) { if (retry_on_timeout-- > 0) {
goto read; goto read;
} else { } else {
dev_err(&ftdi->udev->dev, "TIMED OUT re" dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
"try limit reached\n");
continue; continue;
} }
} else if (retval == 0) { } else if (retval == 0) {
if (retry_on_empty-- > 0) { if (retry_on_empty-- > 0) {
goto read; goto read;
} else { } else {
dev_err(&ftdi->udev->dev, "empty packet" dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
" retry limit reached\n");
continue; continue;
} }
} else { } else {
...@@ -2156,8 +2129,7 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi) ...@@ -2156,8 +2129,7 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
if (read_stop-- > 0) { if (read_stop-- > 0) {
goto read; goto read;
} else { } else {
dev_err(&ftdi->udev->dev, "retry limit " dev_err(&ftdi->udev->dev, "retry limit reached\n");
"reached\n");
continue; continue;
} }
} }
...@@ -2209,30 +2181,26 @@ more:{ ...@@ -2209,30 +2181,26 @@ more:{
return -EFAULT; return -EFAULT;
} else if (packet_bytes > 0) { } else if (packet_bytes > 0) {
char b1 = ftdi->bulk_in_buffer[0]; char b1 = ftdi->bulk_in_buffer[0];
dev_err(&ftdi->udev->dev, "only one byte flushed from F" dev_err(&ftdi->udev->dev, "only one byte flushed from FTDI = %02X\n", b1);
"TDI = %02X\n", b1);
if (retry_on_status-- > 0) { if (retry_on_status-- > 0) {
msleep(5); msleep(5);
goto more; goto more;
} else { } else {
dev_err(&ftdi->udev->dev, "STATUS ERROR retry l" dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
"imit reached\n");
return -EFAULT; return -EFAULT;
} }
} else if (retval == -ETIMEDOUT) { } else if (retval == -ETIMEDOUT) {
if (retry_on_timeout-- > 0) { if (retry_on_timeout-- > 0) {
goto more; goto more;
} else { } else {
dev_err(&ftdi->udev->dev, "TIMED OUT retry limi" dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
"t reached\n");
return -ENOMEM; return -ENOMEM;
} }
} else if (retval == 0) { } else if (retval == 0) {
if (retry_on_empty-- > 0) { if (retry_on_empty-- > 0) {
goto more; goto more;
} else { } else {
dev_err(&ftdi->udev->dev, "empty packet retry l" dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
"imit reached\n");
return -ENOMEM; return -ENOMEM;
} }
} else { } else {
...@@ -2252,8 +2220,8 @@ static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi) ...@@ -2252,8 +2220,8 @@ static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi)
if (ftdi->card_ejected) { if (ftdi->card_ejected) {
} else { } else {
ftdi->card_ejected = 1; ftdi->card_ejected = 1;
dev_err(&ftdi->udev->dev, "CARD EJECTED - controlreg = " dev_err(&ftdi->udev->dev, "CARD EJECTED - controlreg = %08X\n",
"%08X\n", ftdi->controlreg); ftdi->controlreg);
} }
return -ENODEV; return -ENODEV;
} else { } else {
...@@ -2273,8 +2241,7 @@ static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi) ...@@ -2273,8 +2241,7 @@ static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi)
ftdi->platform_data.device) { ftdi->platform_data.device) {
return 0; return 0;
} else { } else {
dev_err(&ftdi->udev->dev, "vendor=%04X pciVID=%04X devi" dev_err(&ftdi->udev->dev, "vendor=%04X pciVID=%04X device=%04X pciPID=%04X\n",
"ce=%04X pciPID=%04X\n",
ftdi->platform_data.vendor, pciVID, ftdi->platform_data.vendor, pciVID,
ftdi->platform_data.device, pciPID); ftdi->platform_data.device, pciPID);
return -ENODEV; return -ENODEV;
...@@ -2378,8 +2345,7 @@ extra:{ ...@@ -2378,8 +2345,7 @@ extra:{
return retval; return retval;
if (0 != (status & OHCI_HCR)) { if (0 != (status & OHCI_HCR)) {
if (--reset_timeout == 0) { if (--reset_timeout == 0) {
dev_err(&ftdi->udev->dev, "USB HC reset timed o" dev_err(&ftdi->udev->dev, "USB HC reset timed out!\n");
"ut!\n");
return -ENODEV; return -ENODEV;
} else { } else {
msleep(5); msleep(5);
...@@ -2782,8 +2748,7 @@ static int ftdi_elan_probe(struct usb_interface *interface, ...@@ -2782,8 +2748,7 @@ static int ftdi_elan_probe(struct usb_interface *interface,
ftdi->bulk_in_endpointAddr = endpoint->bEndpointAddress; ftdi->bulk_in_endpointAddr = endpoint->bEndpointAddress;
ftdi->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); ftdi->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
if (!ftdi->bulk_in_buffer) { if (!ftdi->bulk_in_buffer) {
dev_err(&ftdi->udev->dev, "Could not allocate b" dev_err(&ftdi->udev->dev, "Could not allocate bulk_in_buffer\n");
"ulk_in_buffer\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -2795,8 +2760,7 @@ static int ftdi_elan_probe(struct usb_interface *interface, ...@@ -2795,8 +2760,7 @@ static int ftdi_elan_probe(struct usb_interface *interface,
} }
} }
if (!(ftdi->bulk_in_endpointAddr && ftdi->bulk_out_endpointAddr)) { if (!(ftdi->bulk_in_endpointAddr && ftdi->bulk_out_endpointAddr)) {
dev_err(&ftdi->udev->dev, "Could not find both bulk-in and bulk" dev_err(&ftdi->udev->dev, "Could not find both bulk-in and bulk-out endpoints\n");
"-out endpoints\n");
retval = -ENODEV; retval = -ENODEV;
goto error; goto error;
} }
...@@ -2809,16 +2773,14 @@ static int ftdi_elan_probe(struct usb_interface *interface, ...@@ -2809,16 +2773,14 @@ static int ftdi_elan_probe(struct usb_interface *interface,
ftdi->bulk_out_endpointAddr == 0x02) { ftdi->bulk_out_endpointAddr == 0x02) {
retval = usb_register_dev(interface, &ftdi_elan_jtag_class); retval = usb_register_dev(interface, &ftdi_elan_jtag_class);
if (retval) { if (retval) {
dev_err(&ftdi->udev->dev, "Not able to get a minor for " dev_err(&ftdi->udev->dev, "Not able to get a minor for this device\n");
"this device.\n");
usb_set_intfdata(interface, NULL); usb_set_intfdata(interface, NULL);
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} else { } else {
ftdi->class = &ftdi_elan_jtag_class; ftdi->class = &ftdi_elan_jtag_class;
dev_info(&ftdi->udev->dev, "USB FDTI=%p JTAG interface " dev_info(&ftdi->udev->dev, "USB FDTI=%p JTAG interface %d now attached to ftdi%d\n",
"%d now attached to ftdi%d\n", ftdi, ftdi, iface_desc->desc.bInterfaceNumber,
iface_desc->desc.bInterfaceNumber,
interface->minor); interface->minor);
return 0; return 0;
} }
...@@ -2826,8 +2788,8 @@ static int ftdi_elan_probe(struct usb_interface *interface, ...@@ -2826,8 +2788,8 @@ static int ftdi_elan_probe(struct usb_interface *interface,
ftdi->bulk_in_endpointAddr == 0x83 && ftdi->bulk_in_endpointAddr == 0x83 &&
ftdi->bulk_out_endpointAddr == 0x04) { ftdi->bulk_out_endpointAddr == 0x04) {
ftdi->class = NULL; ftdi->class = NULL;
dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now a" dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now activated\n",
"ctivated\n", ftdi, iface_desc->desc.bInterfaceNumber); ftdi, iface_desc->desc.bInterfaceNumber);
INIT_DELAYED_WORK(&ftdi->status_work, ftdi_elan_status_work); INIT_DELAYED_WORK(&ftdi->status_work, ftdi_elan_status_work);
INIT_DELAYED_WORK(&ftdi->command_work, ftdi_elan_command_work); INIT_DELAYED_WORK(&ftdi->command_work, ftdi_elan_command_work);
INIT_DELAYED_WORK(&ftdi->respond_work, ftdi_elan_respond_work); INIT_DELAYED_WORK(&ftdi->respond_work, ftdi_elan_respond_work);
...@@ -2854,8 +2816,8 @@ static void ftdi_elan_disconnect(struct usb_interface *interface) ...@@ -2854,8 +2816,8 @@ static void ftdi_elan_disconnect(struct usb_interface *interface)
struct usb_class_driver *class = ftdi->class; struct usb_class_driver *class = ftdi->class;
usb_set_intfdata(interface, NULL); usb_set_intfdata(interface, NULL);
usb_deregister_dev(interface, class); usb_deregister_dev(interface, class);
dev_info(&ftdi->udev->dev, "USB FTDI U132 jtag interface on min" dev_info(&ftdi->udev->dev, "USB FTDI U132 jtag interface on minor %d now disconnected\n",
"or %d now disconnected\n", minor); minor);
} else { } else {
ftdi_status_cancel_work(ftdi); ftdi_status_cancel_work(ftdi);
ftdi_command_cancel_work(ftdi); ftdi_command_cancel_work(ftdi);
...@@ -2874,8 +2836,7 @@ static void ftdi_elan_disconnect(struct usb_interface *interface) ...@@ -2874,8 +2836,7 @@ static void ftdi_elan_disconnect(struct usb_interface *interface)
flush_workqueue(respond_queue); flush_workqueue(respond_queue);
ftdi->disconnected += 1; ftdi->disconnected += 1;
usb_set_intfdata(interface, NULL); usb_set_intfdata(interface, NULL);
dev_info(&ftdi->udev->dev, "USB FTDI U132 host controller inter" dev_info(&ftdi->udev->dev, "USB FTDI U132 host controller interface now disconnected\n");
"face now disconnected\n");
} }
ftdi_elan_put_kref(ftdi); ftdi_elan_put_kref(ftdi);
} }
......
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