aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-04-04 18:16:05 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-24 16:13:59 -0400
commit5acc6e40713cbd754c8d4162f77d6fd062d22317 (patch)
tree0ec251e0a172ed1dd4e791a7045b50b6a3febee2 /drivers/usb/misc
parent8dae693ca9f7337058dc564fb88b13e1e9358e37 (diff)
usb: ftdi-elan: Coalesce formats
Make it easier to find formats. Realign arguments around these changes. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/ftdi-elan.c151
1 files changed, 56 insertions, 95 deletions
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 0487f8e1e817..8cda8814a3ef 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -545,11 +545,10 @@ static void ftdi_elan_status_work(struct work_struct *work)
545 ftdi->stuck_status = 0; 545 ftdi->stuck_status = 0;
546 ftdi->synchronized = 0; 546 ftdi->synchronized = 0;
547 } else if ((ftdi->stuck_status++ % 60) == 1) { 547 } else if ((ftdi->stuck_status++ % 60) == 1) {
548 dev_err(&ftdi->udev->dev, "WRONG type of card inserted " 548 dev_err(&ftdi->udev->dev, "WRONG type of card inserted - please remove\n");
549 "- please remove\n");
550 } else 549 } else
551 dev_err(&ftdi->udev->dev, "WRONG type of card inserted " 550 dev_err(&ftdi->udev->dev, "WRONG type of card inserted - checked %d times\n",
552 "- checked %d times\n", ftdi->stuck_status); 551 ftdi->stuck_status);
553 work_delay_in_msec = 100; 552 work_delay_in_msec = 100;
554 } else if (ftdi->enumerated == 0) { 553 } else if (ftdi->enumerated == 0) {
555 if (ftdi_elan_enumeratePCI(ftdi) == 0) { 554 if (ftdi_elan_enumeratePCI(ftdi) == 0) {
@@ -562,8 +561,7 @@ static void ftdi_elan_status_work(struct work_struct *work)
562 ftdi->initialized = 1; 561 ftdi->initialized = 1;
563 work_delay_in_msec = 500; 562 work_delay_in_msec = 500;
564 } else { 563 } else {
565 dev_err(&ftdi->udev->dev, "initialized failed - trying " 564 dev_err(&ftdi->udev->dev, "initialized failed - trying again in 10 seconds\n");
566 "again in 10 seconds\n");
567 work_delay_in_msec = 1 *1000; 565 work_delay_in_msec = 1 *1000;
568 } 566 }
569 } else if (ftdi->registered == 0) { 567 } else if (ftdi->registered == 0) {
@@ -578,9 +576,7 @@ static void ftdi_elan_status_work(struct work_struct *work)
578 work_delay_in_msec = 250; 576 work_delay_in_msec = 250;
579 } else if (ftdi->controlreg & 0x00400000) { 577 } else if (ftdi->controlreg & 0x00400000) {
580 if (ftdi->gone_away > 0) { 578 if (ftdi->gone_away > 0) {
581 dev_err(&ftdi->udev->dev, "PCI device eject con" 579 dev_err(&ftdi->udev->dev, "PCI device eject confirmed platform_dev.dev.parent=%p platform_dev.dev=%p\n",
582 "firmed platform_dev.dev.parent=%p plat"
583 "form_dev.dev=%p\n",
584 ftdi->platform_dev.dev.parent, 580 ftdi->platform_dev.dev.parent,
585 &ftdi->platform_dev.dev); 581 &ftdi->platform_dev.dev);
586 platform_device_unregister(&ftdi->platform_dev); 582 platform_device_unregister(&ftdi->platform_dev);
@@ -788,17 +784,15 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
788 total_size = ftdi_elan_total_command_size(ftdi, command_size); 784 total_size = ftdi_elan_total_command_size(ftdi, command_size);
789 urb = usb_alloc_urb(0, GFP_KERNEL); 785 urb = usb_alloc_urb(0, GFP_KERNEL);
790 if (!urb) { 786 if (!urb) {
791 dev_err(&ftdi->udev->dev, "could not get a urb to write %d comm" 787 dev_err(&ftdi->udev->dev, "could not get a urb to write %d commands totaling %d bytes to the Uxxx\n",
792 "ands totaling %d bytes to the Uxxx\n", command_size, 788 command_size, total_size);
793 total_size);
794 return -ENOMEM; 789 return -ENOMEM;
795 } 790 }
796 buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL, 791 buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
797 &urb->transfer_dma); 792 &urb->transfer_dma);
798 if (!buf) { 793 if (!buf) {
799 dev_err(&ftdi->udev->dev, "could not get a buffer to write %d c" 794 dev_err(&ftdi->udev->dev, "could not get a buffer to write %d commands totaling %d bytes to the Uxxx\n",
800 "ommands totaling %d bytes to the Uxxx\n", command_size, 795 command_size, total_size);
801 total_size);
802 usb_free_urb(urb); 796 usb_free_urb(urb);
803 return -ENOMEM; 797 return -ENOMEM;
804 } 798 }
@@ -824,9 +818,8 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
824 } 818 }
825 retval = usb_submit_urb(urb, GFP_KERNEL); 819 retval = usb_submit_urb(urb, GFP_KERNEL);
826 if (retval) { 820 if (retval) {
827 dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write " 821 dev_err(&ftdi->udev->dev, "failed %d to submit urb %p to write %d commands totaling %d bytes to the Uxxx\n",
828 "%d commands totaling %d bytes to the Uxxx\n", retval, 822 retval, urb, command_size, total_size);
829 urb, command_size, total_size);
830 usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma); 823 usb_free_coherent(ftdi->udev, total_size, buf, urb->transfer_dma);
831 usb_free_urb(urb); 824 usb_free_urb(urb);
832 return retval; 825 return retval;
@@ -980,8 +973,7 @@ read:{
980 goto have; 973 goto have;
981 } else if (retval == -ETIMEDOUT) { 974 } else if (retval == -ETIMEDOUT) {
982 if (retry_on_timeout-- > 0) { 975 if (retry_on_timeout-- > 0) {
983 dev_err(&ftdi->udev->dev, "TIMED OUT with packe" 976 dev_err(&ftdi->udev->dev, "TIMED OUT with packet_bytes = %d with total %d bytes%s\n",
984 "t_bytes = %d with total %d bytes%s\n",
985 packet_bytes, bytes_read, diag); 977 packet_bytes, bytes_read, diag);
986 goto more; 978 goto more;
987 } else if (bytes_read > 0) { 979 } else if (bytes_read > 0) {
@@ -989,20 +981,17 @@ read:{
989 bytes_read, diag); 981 bytes_read, diag);
990 return -ENOMEM; 982 return -ENOMEM;
991 } else { 983 } else {
992 dev_err(&ftdi->udev->dev, "TIMED OUT with packe" 984 dev_err(&ftdi->udev->dev, "TIMED OUT with packet_bytes = %d with total %d bytes%s\n",
993 "t_bytes = %d with total %d bytes%s\n",
994 packet_bytes, bytes_read, diag); 985 packet_bytes, bytes_read, diag);
995 return -ENOMEM; 986 return -ENOMEM;
996 } 987 }
997 } else if (retval == -EILSEQ) { 988 } else if (retval == -EILSEQ) {
998 dev_err(&ftdi->udev->dev, "error = %d with packet_bytes" 989 dev_err(&ftdi->udev->dev, "error = %d with packet_bytes = %d with total %d bytes%s\n",
999 " = %d with total %d bytes%s\n", retval, 990 retval, packet_bytes, bytes_read, diag);
1000 packet_bytes, bytes_read, diag);
1001 return retval; 991 return retval;
1002 } else if (retval) { 992 } else if (retval) {
1003 dev_err(&ftdi->udev->dev, "error = %d with packet_bytes" 993 dev_err(&ftdi->udev->dev, "error = %d with packet_bytes = %d with total %d bytes%s\n",
1004 " = %d with total %d bytes%s\n", retval, 994 retval, packet_bytes, bytes_read, diag);
1005 packet_bytes, bytes_read, diag);
1006 return retval; 995 return retval;
1007 } else if (packet_bytes == 2) { 996 } else if (packet_bytes == 2) {
1008 unsigned char s0 = ftdi->bulk_in_buffer[0]; 997 unsigned char s0 = ftdi->bulk_in_buffer[0];
@@ -1099,8 +1088,8 @@ have:if (ftdi->bulk_in_left > 0) {
1099 } else if (buscmd == 0x06) { 1088 } else if (buscmd == 0x06) {
1100 } else if (buscmd == 0x0A) { 1089 } else if (buscmd == 0x0A) {
1101 } else 1090 } else
1102 dev_err(&ftdi->udev->dev, "Uxxx unknown(%0X) va" 1091 dev_err(&ftdi->udev->dev, "Uxxx unknown(%0X) value = %08X\n",
1103 "lue = %08X\n", buscmd, data); 1092 buscmd, data);
1104 goto have; 1093 goto have;
1105 } else { 1094 } else {
1106 if ((ftdi->response[0] & 0x80) == 0x00) { 1095 if ((ftdi->response[0] & 0x80) == 0x00) {
@@ -1909,35 +1898,31 @@ more:{
1909 } else if (retry_on_status-- > 0) { 1898 } else if (retry_on_status-- > 0) {
1910 goto more; 1899 goto more;
1911 } else { 1900 } else {
1912 dev_err(&ftdi->udev->dev, "STATUS ERROR retry l" 1901 dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
1913 "imit reached\n");
1914 return -EFAULT; 1902 return -EFAULT;
1915 } 1903 }
1916 } else if (packet_bytes > 0) { 1904 } else if (packet_bytes > 0) {
1917 char b1 = ftdi->bulk_in_buffer[0]; 1905 char b1 = ftdi->bulk_in_buffer[0];
1918 dev_err(&ftdi->udev->dev, "only one byte flushed from F" 1906 dev_err(&ftdi->udev->dev, "only one byte flushed from FTDI = %02X\n",
1919 "TDI = %02X\n", b1); 1907 b1);
1920 if (retry_on_status-- > 0) { 1908 if (retry_on_status-- > 0) {
1921 goto more; 1909 goto more;
1922 } else { 1910 } else {
1923 dev_err(&ftdi->udev->dev, "STATUS ERROR retry l" 1911 dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
1924 "imit reached\n");
1925 return -EFAULT; 1912 return -EFAULT;
1926 } 1913 }
1927 } else if (retval == -ETIMEDOUT) { 1914 } else if (retval == -ETIMEDOUT) {
1928 if (retry_on_timeout-- > 0) { 1915 if (retry_on_timeout-- > 0) {
1929 goto more; 1916 goto more;
1930 } else { 1917 } else {
1931 dev_err(&ftdi->udev->dev, "TIMED OUT retry limi" 1918 dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
1932 "t reached\n");
1933 return -ENOMEM; 1919 return -ENOMEM;
1934 } 1920 }
1935 } else if (retval == 0) { 1921 } else if (retval == 0) {
1936 if (retry_on_empty-- > 0) { 1922 if (retry_on_empty-- > 0) {
1937 goto more; 1923 goto more;
1938 } else { 1924 } else {
1939 dev_err(&ftdi->udev->dev, "empty packet retry l" 1925 dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
1940 "imit reached\n");
1941 return -ENOMEM; 1926 return -ENOMEM;
1942 } 1927 }
1943 } else { 1928 } else {
@@ -1962,14 +1947,12 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
1962 int i = 0; 1947 int i = 0;
1963 urb = usb_alloc_urb(0, GFP_KERNEL); 1948 urb = usb_alloc_urb(0, GFP_KERNEL);
1964 if (!urb) { 1949 if (!urb) {
1965 dev_err(&ftdi->udev->dev, "could not alloc a urb for flush sequ" 1950 dev_err(&ftdi->udev->dev, "could not alloc a urb for flush sequence\n");
1966 "ence\n");
1967 return -ENOMEM; 1951 return -ENOMEM;
1968 } 1952 }
1969 buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); 1953 buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
1970 if (!buf) { 1954 if (!buf) {
1971 dev_err(&ftdi->udev->dev, "could not get a buffer for flush seq" 1955 dev_err(&ftdi->udev->dev, "could not get a buffer for flush sequence\n");
1972 "uence\n");
1973 usb_free_urb(urb); 1956 usb_free_urb(urb);
1974 return -ENOMEM; 1957 return -ENOMEM;
1975 } 1958 }
@@ -1981,8 +1964,7 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
1981 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 1964 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1982 retval = usb_submit_urb(urb, GFP_KERNEL); 1965 retval = usb_submit_urb(urb, GFP_KERNEL);
1983 if (retval) { 1966 if (retval) {
1984 dev_err(&ftdi->udev->dev, "failed to submit urb containing the " 1967 dev_err(&ftdi->udev->dev, "failed to submit urb containing the flush sequence\n");
1985 "flush sequence\n");
1986 usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma); 1968 usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
1987 usb_free_urb(urb); 1969 usb_free_urb(urb);
1988 return -ENOMEM; 1970 return -ENOMEM;
@@ -2005,14 +1987,12 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
2005 int i = 0; 1987 int i = 0;
2006 urb = usb_alloc_urb(0, GFP_KERNEL); 1988 urb = usb_alloc_urb(0, GFP_KERNEL);
2007 if (!urb) { 1989 if (!urb) {
2008 dev_err(&ftdi->udev->dev, "could not get a urb for the reset se" 1990 dev_err(&ftdi->udev->dev, "could not get a urb for the reset sequence\n");
2009 "quence\n");
2010 return -ENOMEM; 1991 return -ENOMEM;
2011 } 1992 }
2012 buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); 1993 buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
2013 if (!buf) { 1994 if (!buf) {
2014 dev_err(&ftdi->udev->dev, "could not get a buffer for the reset" 1995 dev_err(&ftdi->udev->dev, "could not get a buffer for the reset sequence\n");
2015 " sequence\n");
2016 usb_free_urb(urb); 1996 usb_free_urb(urb);
2017 return -ENOMEM; 1997 return -ENOMEM;
2018 } 1998 }
@@ -2026,8 +2006,7 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
2026 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 2006 urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
2027 retval = usb_submit_urb(urb, GFP_KERNEL); 2007 retval = usb_submit_urb(urb, GFP_KERNEL);
2028 if (retval) { 2008 if (retval) {
2029 dev_err(&ftdi->udev->dev, "failed to submit urb containing the " 2009 dev_err(&ftdi->udev->dev, "failed to submit urb containing the reset sequence\n");
2030 "reset sequence\n");
2031 usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma); 2010 usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
2032 usb_free_urb(urb); 2011 usb_free_urb(urb);
2033 return -ENOMEM; 2012 return -ENOMEM;
@@ -2095,8 +2074,7 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
2095 } else if (read_stop-- > 0) { 2074 } else if (read_stop-- > 0) {
2096 goto read; 2075 goto read;
2097 } else { 2076 } else {
2098 dev_err(&ftdi->udev->dev, "retr" 2077 dev_err(&ftdi->udev->dev, "retry limit reached\n");
2099 "y limit reached\n");
2100 continue; 2078 continue;
2101 } 2079 }
2102 } 2080 }
@@ -2112,16 +2090,14 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
2112 if (read_stop-- > 0) { 2090 if (read_stop-- > 0) {
2113 goto read; 2091 goto read;
2114 } else { 2092 } else {
2115 dev_err(&ftdi->udev->dev, "retr" 2093 dev_err(&ftdi->udev->dev, "retry limit reached\n");
2116 "y limit reached\n");
2117 continue; 2094 continue;
2118 } 2095 }
2119 } else { 2096 } else {
2120 if (read_stop-- > 0) { 2097 if (read_stop-- > 0) {
2121 goto read; 2098 goto read;
2122 } else { 2099 } else {
2123 dev_err(&ftdi->udev->dev, "retr" 2100 dev_err(&ftdi->udev->dev, "retry limit reached\n");
2124 "y limit reached\n");
2125 continue; 2101 continue;
2126 } 2102 }
2127 } 2103 }
@@ -2129,24 +2105,21 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
2129 if (read_stop-- > 0) { 2105 if (read_stop-- > 0) {
2130 goto read; 2106 goto read;
2131 } else { 2107 } else {
2132 dev_err(&ftdi->udev->dev, "retry limit " 2108 dev_err(&ftdi->udev->dev, "retry limit reached\n");
2133 "reached\n");
2134 continue; 2109 continue;
2135 } 2110 }
2136 } else if (retval == -ETIMEDOUT) { 2111 } else if (retval == -ETIMEDOUT) {
2137 if (retry_on_timeout-- > 0) { 2112 if (retry_on_timeout-- > 0) {
2138 goto read; 2113 goto read;
2139 } else { 2114 } else {
2140 dev_err(&ftdi->udev->dev, "TIMED OUT re" 2115 dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
2141 "try limit reached\n");
2142 continue; 2116 continue;
2143 } 2117 }
2144 } else if (retval == 0) { 2118 } else if (retval == 0) {
2145 if (retry_on_empty-- > 0) { 2119 if (retry_on_empty-- > 0) {
2146 goto read; 2120 goto read;
2147 } else { 2121 } else {
2148 dev_err(&ftdi->udev->dev, "empty packet" 2122 dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
2149 " retry limit reached\n");
2150 continue; 2123 continue;
2151 } 2124 }
2152 } else { 2125 } else {
@@ -2156,8 +2129,7 @@ static int ftdi_elan_synchronize(struct usb_ftdi *ftdi)
2156 if (read_stop-- > 0) { 2129 if (read_stop-- > 0) {
2157 goto read; 2130 goto read;
2158 } else { 2131 } else {
2159 dev_err(&ftdi->udev->dev, "retry limit " 2132 dev_err(&ftdi->udev->dev, "retry limit reached\n");
2160 "reached\n");
2161 continue; 2133 continue;
2162 } 2134 }
2163 } 2135 }
@@ -2209,30 +2181,26 @@ more:{
2209 return -EFAULT; 2181 return -EFAULT;
2210 } else if (packet_bytes > 0) { 2182 } else if (packet_bytes > 0) {
2211 char b1 = ftdi->bulk_in_buffer[0]; 2183 char b1 = ftdi->bulk_in_buffer[0];
2212 dev_err(&ftdi->udev->dev, "only one byte flushed from F" 2184 dev_err(&ftdi->udev->dev, "only one byte flushed from FTDI = %02X\n", b1);
2213 "TDI = %02X\n", b1);
2214 if (retry_on_status-- > 0) { 2185 if (retry_on_status-- > 0) {
2215 msleep(5); 2186 msleep(5);
2216 goto more; 2187 goto more;
2217 } else { 2188 } else {
2218 dev_err(&ftdi->udev->dev, "STATUS ERROR retry l" 2189 dev_err(&ftdi->udev->dev, "STATUS ERROR retry limit reached\n");
2219 "imit reached\n");
2220 return -EFAULT; 2190 return -EFAULT;
2221 } 2191 }
2222 } else if (retval == -ETIMEDOUT) { 2192 } else if (retval == -ETIMEDOUT) {
2223 if (retry_on_timeout-- > 0) { 2193 if (retry_on_timeout-- > 0) {
2224 goto more; 2194 goto more;
2225 } else { 2195 } else {
2226 dev_err(&ftdi->udev->dev, "TIMED OUT retry limi" 2196 dev_err(&ftdi->udev->dev, "TIMED OUT retry limit reached\n");
2227 "t reached\n");
2228 return -ENOMEM; 2197 return -ENOMEM;
2229 } 2198 }
2230 } else if (retval == 0) { 2199 } else if (retval == 0) {
2231 if (retry_on_empty-- > 0) { 2200 if (retry_on_empty-- > 0) {
2232 goto more; 2201 goto more;
2233 } else { 2202 } else {
2234 dev_err(&ftdi->udev->dev, "empty packet retry l" 2203 dev_err(&ftdi->udev->dev, "empty packet retry limit reached\n");
2235 "imit reached\n");
2236 return -ENOMEM; 2204 return -ENOMEM;
2237 } 2205 }
2238 } else { 2206 } else {
@@ -2252,8 +2220,8 @@ static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi)
2252 if (ftdi->card_ejected) { 2220 if (ftdi->card_ejected) {
2253 } else { 2221 } else {
2254 ftdi->card_ejected = 1; 2222 ftdi->card_ejected = 1;
2255 dev_err(&ftdi->udev->dev, "CARD EJECTED - controlreg = " 2223 dev_err(&ftdi->udev->dev, "CARD EJECTED - controlreg = %08X\n",
2256 "%08X\n", ftdi->controlreg); 2224 ftdi->controlreg);
2257 } 2225 }
2258 return -ENODEV; 2226 return -ENODEV;
2259 } else { 2227 } else {
@@ -2273,8 +2241,7 @@ static int ftdi_elan_checkingPCI(struct usb_ftdi *ftdi)
2273 ftdi->platform_data.device) { 2241 ftdi->platform_data.device) {
2274 return 0; 2242 return 0;
2275 } else { 2243 } else {
2276 dev_err(&ftdi->udev->dev, "vendor=%04X pciVID=%04X devi" 2244 dev_err(&ftdi->udev->dev, "vendor=%04X pciVID=%04X device=%04X pciPID=%04X\n",
2277 "ce=%04X pciPID=%04X\n",
2278 ftdi->platform_data.vendor, pciVID, 2245 ftdi->platform_data.vendor, pciVID,
2279 ftdi->platform_data.device, pciPID); 2246 ftdi->platform_data.device, pciPID);
2280 return -ENODEV; 2247 return -ENODEV;
@@ -2378,8 +2345,7 @@ extra:{
2378 return retval; 2345 return retval;
2379 if (0 != (status & OHCI_HCR)) { 2346 if (0 != (status & OHCI_HCR)) {
2380 if (--reset_timeout == 0) { 2347 if (--reset_timeout == 0) {
2381 dev_err(&ftdi->udev->dev, "USB HC reset timed o" 2348 dev_err(&ftdi->udev->dev, "USB HC reset timed out!\n");
2382 "ut!\n");
2383 return -ENODEV; 2349 return -ENODEV;
2384 } else { 2350 } else {
2385 msleep(5); 2351 msleep(5);
@@ -2782,8 +2748,7 @@ static int ftdi_elan_probe(struct usb_interface *interface,
2782 ftdi->bulk_in_endpointAddr = endpoint->bEndpointAddress; 2748 ftdi->bulk_in_endpointAddr = endpoint->bEndpointAddress;
2783 ftdi->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); 2749 ftdi->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
2784 if (!ftdi->bulk_in_buffer) { 2750 if (!ftdi->bulk_in_buffer) {
2785 dev_err(&ftdi->udev->dev, "Could not allocate b" 2751 dev_err(&ftdi->udev->dev, "Could not allocate bulk_in_buffer\n");
2786 "ulk_in_buffer\n");
2787 retval = -ENOMEM; 2752 retval = -ENOMEM;
2788 goto error; 2753 goto error;
2789 } 2754 }
@@ -2795,8 +2760,7 @@ static int ftdi_elan_probe(struct usb_interface *interface,
2795 } 2760 }
2796 } 2761 }
2797 if (!(ftdi->bulk_in_endpointAddr && ftdi->bulk_out_endpointAddr)) { 2762 if (!(ftdi->bulk_in_endpointAddr && ftdi->bulk_out_endpointAddr)) {
2798 dev_err(&ftdi->udev->dev, "Could not find both bulk-in and bulk" 2763 dev_err(&ftdi->udev->dev, "Could not find both bulk-in and bulk-out endpoints\n");
2799 "-out endpoints\n");
2800 retval = -ENODEV; 2764 retval = -ENODEV;
2801 goto error; 2765 goto error;
2802 } 2766 }
@@ -2809,16 +2773,14 @@ static int ftdi_elan_probe(struct usb_interface *interface,
2809 ftdi->bulk_out_endpointAddr == 0x02) { 2773 ftdi->bulk_out_endpointAddr == 0x02) {
2810 retval = usb_register_dev(interface, &ftdi_elan_jtag_class); 2774 retval = usb_register_dev(interface, &ftdi_elan_jtag_class);
2811 if (retval) { 2775 if (retval) {
2812 dev_err(&ftdi->udev->dev, "Not able to get a minor for " 2776 dev_err(&ftdi->udev->dev, "Not able to get a minor for this device\n");
2813 "this device.\n");
2814 usb_set_intfdata(interface, NULL); 2777 usb_set_intfdata(interface, NULL);
2815 retval = -ENOMEM; 2778 retval = -ENOMEM;
2816 goto error; 2779 goto error;
2817 } else { 2780 } else {
2818 ftdi->class = &ftdi_elan_jtag_class; 2781 ftdi->class = &ftdi_elan_jtag_class;
2819 dev_info(&ftdi->udev->dev, "USB FDTI=%p JTAG interface " 2782 dev_info(&ftdi->udev->dev, "USB FDTI=%p JTAG interface %d now attached to ftdi%d\n",
2820 "%d now attached to ftdi%d\n", ftdi, 2783 ftdi, iface_desc->desc.bInterfaceNumber,
2821 iface_desc->desc.bInterfaceNumber,
2822 interface->minor); 2784 interface->minor);
2823 return 0; 2785 return 0;
2824 } 2786 }
@@ -2826,8 +2788,8 @@ static int ftdi_elan_probe(struct usb_interface *interface,
2826 ftdi->bulk_in_endpointAddr == 0x83 && 2788 ftdi->bulk_in_endpointAddr == 0x83 &&
2827 ftdi->bulk_out_endpointAddr == 0x04) { 2789 ftdi->bulk_out_endpointAddr == 0x04) {
2828 ftdi->class = NULL; 2790 ftdi->class = NULL;
2829 dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now a" 2791 dev_info(&ftdi->udev->dev, "USB FDTI=%p ELAN interface %d now activated\n",
2830 "ctivated\n", ftdi, iface_desc->desc.bInterfaceNumber); 2792 ftdi, iface_desc->desc.bInterfaceNumber);
2831 INIT_DELAYED_WORK(&ftdi->status_work, ftdi_elan_status_work); 2793 INIT_DELAYED_WORK(&ftdi->status_work, ftdi_elan_status_work);
2832 INIT_DELAYED_WORK(&ftdi->command_work, ftdi_elan_command_work); 2794 INIT_DELAYED_WORK(&ftdi->command_work, ftdi_elan_command_work);
2833 INIT_DELAYED_WORK(&ftdi->respond_work, ftdi_elan_respond_work); 2795 INIT_DELAYED_WORK(&ftdi->respond_work, ftdi_elan_respond_work);
@@ -2854,8 +2816,8 @@ static void ftdi_elan_disconnect(struct usb_interface *interface)
2854 struct usb_class_driver *class = ftdi->class; 2816 struct usb_class_driver *class = ftdi->class;
2855 usb_set_intfdata(interface, NULL); 2817 usb_set_intfdata(interface, NULL);
2856 usb_deregister_dev(interface, class); 2818 usb_deregister_dev(interface, class);
2857 dev_info(&ftdi->udev->dev, "USB FTDI U132 jtag interface on min" 2819 dev_info(&ftdi->udev->dev, "USB FTDI U132 jtag interface on minor %d now disconnected\n",
2858 "or %d now disconnected\n", minor); 2820 minor);
2859 } else { 2821 } else {
2860 ftdi_status_cancel_work(ftdi); 2822 ftdi_status_cancel_work(ftdi);
2861 ftdi_command_cancel_work(ftdi); 2823 ftdi_command_cancel_work(ftdi);
@@ -2874,8 +2836,7 @@ static void ftdi_elan_disconnect(struct usb_interface *interface)
2874 flush_workqueue(respond_queue); 2836 flush_workqueue(respond_queue);
2875 ftdi->disconnected += 1; 2837 ftdi->disconnected += 1;
2876 usb_set_intfdata(interface, NULL); 2838 usb_set_intfdata(interface, NULL);
2877 dev_info(&ftdi->udev->dev, "USB FTDI U132 host controller inter" 2839 dev_info(&ftdi->udev->dev, "USB FTDI U132 host controller interface now disconnected\n");
2878 "face now disconnected\n");
2879 } 2840 }
2880 ftdi_elan_put_kref(ftdi); 2841 ftdi_elan_put_kref(ftdi);
2881} 2842}