diff options
Diffstat (limited to 'drivers')
43 files changed, 481 insertions, 384 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 35603dd4e6c5..094bdc355b1f 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -302,6 +302,12 @@ struct smi_info { | |||
302 | 302 | ||
303 | static int force_kipmid[SI_MAX_PARMS]; | 303 | static int force_kipmid[SI_MAX_PARMS]; |
304 | static int num_force_kipmid; | 304 | static int num_force_kipmid; |
305 | #ifdef CONFIG_PCI | ||
306 | static int pci_registered; | ||
307 | #endif | ||
308 | #ifdef CONFIG_PPC_OF | ||
309 | static int of_registered; | ||
310 | #endif | ||
305 | 311 | ||
306 | static unsigned int kipmid_max_busy_us[SI_MAX_PARMS]; | 312 | static unsigned int kipmid_max_busy_us[SI_MAX_PARMS]; |
307 | static int num_max_busy_us; | 313 | static int num_max_busy_us; |
@@ -1018,7 +1024,7 @@ static int ipmi_thread(void *data) | |||
1018 | else if (smi_result == SI_SM_IDLE) | 1024 | else if (smi_result == SI_SM_IDLE) |
1019 | schedule_timeout_interruptible(100); | 1025 | schedule_timeout_interruptible(100); |
1020 | else | 1026 | else |
1021 | schedule_timeout_interruptible(0); | 1027 | schedule_timeout_interruptible(1); |
1022 | } | 1028 | } |
1023 | return 0; | 1029 | return 0; |
1024 | } | 1030 | } |
@@ -3314,6 +3320,8 @@ static __devinit int init_ipmi_si(void) | |||
3314 | rv = pci_register_driver(&ipmi_pci_driver); | 3320 | rv = pci_register_driver(&ipmi_pci_driver); |
3315 | if (rv) | 3321 | if (rv) |
3316 | printk(KERN_ERR PFX "Unable to register PCI driver: %d\n", rv); | 3322 | printk(KERN_ERR PFX "Unable to register PCI driver: %d\n", rv); |
3323 | else | ||
3324 | pci_registered = 1; | ||
3317 | #endif | 3325 | #endif |
3318 | 3326 | ||
3319 | #ifdef CONFIG_ACPI | 3327 | #ifdef CONFIG_ACPI |
@@ -3330,6 +3338,7 @@ static __devinit int init_ipmi_si(void) | |||
3330 | 3338 | ||
3331 | #ifdef CONFIG_PPC_OF | 3339 | #ifdef CONFIG_PPC_OF |
3332 | of_register_platform_driver(&ipmi_of_platform_driver); | 3340 | of_register_platform_driver(&ipmi_of_platform_driver); |
3341 | of_registered = 1; | ||
3333 | #endif | 3342 | #endif |
3334 | 3343 | ||
3335 | /* We prefer devices with interrupts, but in the case of a machine | 3344 | /* We prefer devices with interrupts, but in the case of a machine |
@@ -3383,11 +3392,13 @@ static __devinit int init_ipmi_si(void) | |||
3383 | if (unload_when_empty && list_empty(&smi_infos)) { | 3392 | if (unload_when_empty && list_empty(&smi_infos)) { |
3384 | mutex_unlock(&smi_infos_lock); | 3393 | mutex_unlock(&smi_infos_lock); |
3385 | #ifdef CONFIG_PCI | 3394 | #ifdef CONFIG_PCI |
3386 | pci_unregister_driver(&ipmi_pci_driver); | 3395 | if (pci_registered) |
3396 | pci_unregister_driver(&ipmi_pci_driver); | ||
3387 | #endif | 3397 | #endif |
3388 | 3398 | ||
3389 | #ifdef CONFIG_PPC_OF | 3399 | #ifdef CONFIG_PPC_OF |
3390 | of_unregister_platform_driver(&ipmi_of_platform_driver); | 3400 | if (of_registered) |
3401 | of_unregister_platform_driver(&ipmi_of_platform_driver); | ||
3391 | #endif | 3402 | #endif |
3392 | driver_unregister(&ipmi_driver.driver); | 3403 | driver_unregister(&ipmi_driver.driver); |
3393 | printk(KERN_WARNING PFX | 3404 | printk(KERN_WARNING PFX |
@@ -3478,14 +3489,16 @@ static __exit void cleanup_ipmi_si(void) | |||
3478 | return; | 3489 | return; |
3479 | 3490 | ||
3480 | #ifdef CONFIG_PCI | 3491 | #ifdef CONFIG_PCI |
3481 | pci_unregister_driver(&ipmi_pci_driver); | 3492 | if (pci_registered) |
3493 | pci_unregister_driver(&ipmi_pci_driver); | ||
3482 | #endif | 3494 | #endif |
3483 | #ifdef CONFIG_ACPI | 3495 | #ifdef CONFIG_ACPI |
3484 | pnp_unregister_driver(&ipmi_pnp_driver); | 3496 | pnp_unregister_driver(&ipmi_pnp_driver); |
3485 | #endif | 3497 | #endif |
3486 | 3498 | ||
3487 | #ifdef CONFIG_PPC_OF | 3499 | #ifdef CONFIG_PPC_OF |
3488 | of_unregister_platform_driver(&ipmi_of_platform_driver); | 3500 | if (of_registered) |
3501 | of_unregister_platform_driver(&ipmi_of_platform_driver); | ||
3489 | #endif | 3502 | #endif |
3490 | 3503 | ||
3491 | mutex_lock(&smi_infos_lock); | 3504 | mutex_lock(&smi_infos_lock); |
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 724038dab4ca..7face915b963 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | # | 1 | # |
2 | # GPIO infrastructure and expanders | 2 | # platform-neutral GPIO infrastructure and expanders |
3 | # | 3 | # |
4 | 4 | ||
5 | config ARCH_WANT_OPTIONAL_GPIOLIB | 5 | config ARCH_WANT_OPTIONAL_GPIOLIB |
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 51c3cdd41b5a..e53dcff49b4f 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile | |||
@@ -1,4 +1,8 @@ | |||
1 | # gpio support: dedicated expander chips, etc | 1 | # generic gpio support: dedicated expander chips, etc |
2 | # | ||
3 | # NOTE: platform-specific GPIO drivers don't belong in the | ||
4 | # drivers/gpio directory; put them with other platform setup | ||
5 | # code, IRQ controllers, board init, etc. | ||
2 | 6 | ||
3 | ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG | 7 | ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG |
4 | 8 | ||
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index de033b7ac21f..d827ce570a8c 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c | |||
@@ -777,7 +777,7 @@ static int __devinit ds1307_probe(struct i2c_client *client, | |||
777 | 777 | ||
778 | read_rtc: | 778 | read_rtc: |
779 | /* read RTC registers */ | 779 | /* read RTC registers */ |
780 | tmp = ds1307->read_block_data(ds1307->client, 0, 8, buf); | 780 | tmp = ds1307->read_block_data(ds1307->client, ds1307->offset, 8, buf); |
781 | if (tmp != 8) { | 781 | if (tmp != 8) { |
782 | pr_debug("read error %d\n", tmp); | 782 | pr_debug("read error %d\n", tmp); |
783 | err = -EIO; | 783 | err = -EIO; |
@@ -862,7 +862,7 @@ read_rtc: | |||
862 | if (ds1307->regs[DS1307_REG_HOUR] & DS1307_BIT_PM) | 862 | if (ds1307->regs[DS1307_REG_HOUR] & DS1307_BIT_PM) |
863 | tmp += 12; | 863 | tmp += 12; |
864 | i2c_smbus_write_byte_data(client, | 864 | i2c_smbus_write_byte_data(client, |
865 | DS1307_REG_HOUR, | 865 | ds1307->offset + DS1307_REG_HOUR, |
866 | bin2bcd(tmp)); | 866 | bin2bcd(tmp)); |
867 | } | 867 | } |
868 | 868 | ||
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 9eb62a256e9a..cd6cf575902e 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -930,6 +930,83 @@ static void cpm_uart_config_port(struct uart_port *port, int flags) | |||
930 | } | 930 | } |
931 | } | 931 | } |
932 | 932 | ||
933 | #if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_CPM_CONSOLE) | ||
934 | /* | ||
935 | * Write a string to the serial port | ||
936 | * Note that this is called with interrupts already disabled | ||
937 | */ | ||
938 | static void cpm_uart_early_write(struct uart_cpm_port *pinfo, | ||
939 | const char *string, u_int count) | ||
940 | { | ||
941 | unsigned int i; | ||
942 | cbd_t __iomem *bdp, *bdbase; | ||
943 | unsigned char *cpm_outp_addr; | ||
944 | |||
945 | /* Get the address of the host memory buffer. | ||
946 | */ | ||
947 | bdp = pinfo->tx_cur; | ||
948 | bdbase = pinfo->tx_bd_base; | ||
949 | |||
950 | /* | ||
951 | * Now, do each character. This is not as bad as it looks | ||
952 | * since this is a holding FIFO and not a transmitting FIFO. | ||
953 | * We could add the complexity of filling the entire transmit | ||
954 | * buffer, but we would just wait longer between accesses...... | ||
955 | */ | ||
956 | for (i = 0; i < count; i++, string++) { | ||
957 | /* Wait for transmitter fifo to empty. | ||
958 | * Ready indicates output is ready, and xmt is doing | ||
959 | * that, not that it is ready for us to send. | ||
960 | */ | ||
961 | while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) | ||
962 | ; | ||
963 | |||
964 | /* Send the character out. | ||
965 | * If the buffer address is in the CPM DPRAM, don't | ||
966 | * convert it. | ||
967 | */ | ||
968 | cpm_outp_addr = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), | ||
969 | pinfo); | ||
970 | *cpm_outp_addr = *string; | ||
971 | |||
972 | out_be16(&bdp->cbd_datlen, 1); | ||
973 | setbits16(&bdp->cbd_sc, BD_SC_READY); | ||
974 | |||
975 | if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP) | ||
976 | bdp = bdbase; | ||
977 | else | ||
978 | bdp++; | ||
979 | |||
980 | /* if a LF, also do CR... */ | ||
981 | if (*string == 10) { | ||
982 | while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) | ||
983 | ; | ||
984 | |||
985 | cpm_outp_addr = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), | ||
986 | pinfo); | ||
987 | *cpm_outp_addr = 13; | ||
988 | |||
989 | out_be16(&bdp->cbd_datlen, 1); | ||
990 | setbits16(&bdp->cbd_sc, BD_SC_READY); | ||
991 | |||
992 | if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP) | ||
993 | bdp = bdbase; | ||
994 | else | ||
995 | bdp++; | ||
996 | } | ||
997 | } | ||
998 | |||
999 | /* | ||
1000 | * Finally, Wait for transmitter & holding register to empty | ||
1001 | * and restore the IER | ||
1002 | */ | ||
1003 | while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) | ||
1004 | ; | ||
1005 | |||
1006 | pinfo->tx_cur = bdp; | ||
1007 | } | ||
1008 | #endif | ||
1009 | |||
933 | #ifdef CONFIG_CONSOLE_POLL | 1010 | #ifdef CONFIG_CONSOLE_POLL |
934 | /* Serial polling routines for writing and reading from the uart while | 1011 | /* Serial polling routines for writing and reading from the uart while |
935 | * in an interrupt or debug context. | 1012 | * in an interrupt or debug context. |
@@ -999,7 +1076,7 @@ static void cpm_put_poll_char(struct uart_port *port, | |||
999 | static char ch[2]; | 1076 | static char ch[2]; |
1000 | 1077 | ||
1001 | ch[0] = (char)c; | 1078 | ch[0] = (char)c; |
1002 | cpm_uart_early_write(pinfo->port.line, ch, 1); | 1079 | cpm_uart_early_write(pinfo, ch, 1); |
1003 | } | 1080 | } |
1004 | #endif /* CONFIG_CONSOLE_POLL */ | 1081 | #endif /* CONFIG_CONSOLE_POLL */ |
1005 | 1082 | ||
@@ -1130,9 +1207,6 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
1130 | u_int count) | 1207 | u_int count) |
1131 | { | 1208 | { |
1132 | struct uart_cpm_port *pinfo = &cpm_uart_ports[co->index]; | 1209 | struct uart_cpm_port *pinfo = &cpm_uart_ports[co->index]; |
1133 | unsigned int i; | ||
1134 | cbd_t __iomem *bdp, *bdbase; | ||
1135 | unsigned char *cp; | ||
1136 | unsigned long flags; | 1210 | unsigned long flags; |
1137 | int nolock = oops_in_progress; | 1211 | int nolock = oops_in_progress; |
1138 | 1212 | ||
@@ -1142,66 +1216,7 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
1142 | spin_lock_irqsave(&pinfo->port.lock, flags); | 1216 | spin_lock_irqsave(&pinfo->port.lock, flags); |
1143 | } | 1217 | } |
1144 | 1218 | ||
1145 | /* Get the address of the host memory buffer. | 1219 | cpm_uart_early_write(pinfo, s, count); |
1146 | */ | ||
1147 | bdp = pinfo->tx_cur; | ||
1148 | bdbase = pinfo->tx_bd_base; | ||
1149 | |||
1150 | /* | ||
1151 | * Now, do each character. This is not as bad as it looks | ||
1152 | * since this is a holding FIFO and not a transmitting FIFO. | ||
1153 | * We could add the complexity of filling the entire transmit | ||
1154 | * buffer, but we would just wait longer between accesses...... | ||
1155 | */ | ||
1156 | for (i = 0; i < count; i++, s++) { | ||
1157 | /* Wait for transmitter fifo to empty. | ||
1158 | * Ready indicates output is ready, and xmt is doing | ||
1159 | * that, not that it is ready for us to send. | ||
1160 | */ | ||
1161 | while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) | ||
1162 | ; | ||
1163 | |||
1164 | /* Send the character out. | ||
1165 | * If the buffer address is in the CPM DPRAM, don't | ||
1166 | * convert it. | ||
1167 | */ | ||
1168 | cp = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo); | ||
1169 | *cp = *s; | ||
1170 | |||
1171 | out_be16(&bdp->cbd_datlen, 1); | ||
1172 | setbits16(&bdp->cbd_sc, BD_SC_READY); | ||
1173 | |||
1174 | if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP) | ||
1175 | bdp = bdbase; | ||
1176 | else | ||
1177 | bdp++; | ||
1178 | |||
1179 | /* if a LF, also do CR... */ | ||
1180 | if (*s == 10) { | ||
1181 | while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) | ||
1182 | ; | ||
1183 | |||
1184 | cp = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo); | ||
1185 | *cp = 13; | ||
1186 | |||
1187 | out_be16(&bdp->cbd_datlen, 1); | ||
1188 | setbits16(&bdp->cbd_sc, BD_SC_READY); | ||
1189 | |||
1190 | if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP) | ||
1191 | bdp = bdbase; | ||
1192 | else | ||
1193 | bdp++; | ||
1194 | } | ||
1195 | } | ||
1196 | |||
1197 | /* | ||
1198 | * Finally, Wait for transmitter & holding register to empty | ||
1199 | * and restore the IER | ||
1200 | */ | ||
1201 | while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) | ||
1202 | ; | ||
1203 | |||
1204 | pinfo->tx_cur = bdp; | ||
1205 | 1220 | ||
1206 | if (unlikely(nolock)) { | 1221 | if (unlikely(nolock)) { |
1207 | local_irq_restore(flags); | 1222 | local_irq_restore(flags); |
diff --git a/drivers/staging/batman-adv/bat_sysfs.c b/drivers/staging/batman-adv/bat_sysfs.c index e2c000b80ca0..212bc21e6d68 100644 --- a/drivers/staging/batman-adv/bat_sysfs.c +++ b/drivers/staging/batman-adv/bat_sysfs.c | |||
@@ -225,9 +225,9 @@ static struct bat_attribute *mesh_attrs[] = { | |||
225 | NULL, | 225 | NULL, |
226 | }; | 226 | }; |
227 | 227 | ||
228 | static ssize_t transtable_local_read(struct kobject *kobj, | 228 | static ssize_t transtable_local_read(struct file *filp, struct kobject *kobj, |
229 | struct bin_attribute *bin_attr, | 229 | struct bin_attribute *bin_attr, |
230 | char *buff, loff_t off, size_t count) | 230 | char *buff, loff_t off, size_t count) |
231 | { | 231 | { |
232 | struct device *dev = to_dev(kobj->parent); | 232 | struct device *dev = to_dev(kobj->parent); |
233 | struct net_device *net_dev = to_net_dev(dev); | 233 | struct net_device *net_dev = to_net_dev(dev); |
@@ -235,9 +235,9 @@ static ssize_t transtable_local_read(struct kobject *kobj, | |||
235 | return hna_local_fill_buffer_text(net_dev, buff, count, off); | 235 | return hna_local_fill_buffer_text(net_dev, buff, count, off); |
236 | } | 236 | } |
237 | 237 | ||
238 | static ssize_t transtable_global_read(struct kobject *kobj, | 238 | static ssize_t transtable_global_read(struct file *filp, struct kobject *kobj, |
239 | struct bin_attribute *bin_attr, | 239 | struct bin_attribute *bin_attr, |
240 | char *buff, loff_t off, size_t count) | 240 | char *buff, loff_t off, size_t count) |
241 | { | 241 | { |
242 | struct device *dev = to_dev(kobj->parent); | 242 | struct device *dev = to_dev(kobj->parent); |
243 | struct net_device *net_dev = to_net_dev(dev); | 243 | struct net_device *net_dev = to_net_dev(dev); |
@@ -245,9 +245,9 @@ static ssize_t transtable_global_read(struct kobject *kobj, | |||
245 | return hna_global_fill_buffer_text(net_dev, buff, count, off); | 245 | return hna_global_fill_buffer_text(net_dev, buff, count, off); |
246 | } | 246 | } |
247 | 247 | ||
248 | static ssize_t originators_read(struct kobject *kobj, | 248 | static ssize_t originators_read(struct file *filp, struct kobject *kobj, |
249 | struct bin_attribute *bin_attr, | 249 | struct bin_attribute *bin_attr, |
250 | char *buff, loff_t off, size_t count) | 250 | char *buff, loff_t off, size_t count) |
251 | { | 251 | { |
252 | struct device *dev = to_dev(kobj->parent); | 252 | struct device *dev = to_dev(kobj->parent); |
253 | struct net_device *net_dev = to_net_dev(dev); | 253 | struct net_device *net_dev = to_net_dev(dev); |
@@ -255,9 +255,9 @@ static ssize_t originators_read(struct kobject *kobj, | |||
255 | return orig_fill_buffer_text(net_dev, buff, count, off); | 255 | return orig_fill_buffer_text(net_dev, buff, count, off); |
256 | } | 256 | } |
257 | 257 | ||
258 | static ssize_t vis_data_read(struct kobject *kobj, | 258 | static ssize_t vis_data_read(struct file *filp, struct kobject *kobj, |
259 | struct bin_attribute *bin_attr, | 259 | struct bin_attribute *bin_attr, |
260 | char *buff, loff_t off, size_t count) | 260 | char *buff, loff_t off, size_t count) |
261 | { | 261 | { |
262 | struct device *dev = to_dev(kobj->parent); | 262 | struct device *dev = to_dev(kobj->parent); |
263 | struct net_device *net_dev = to_net_dev(dev); | 263 | struct net_device *net_dev = to_net_dev(dev); |
diff --git a/drivers/staging/batman-adv/device.c b/drivers/staging/batman-adv/device.c index 7eb6559e0315..32204b5572d0 100644 --- a/drivers/staging/batman-adv/device.c +++ b/drivers/staging/batman-adv/device.c | |||
@@ -196,7 +196,7 @@ ssize_t bat_device_read(struct file *file, char __user *buf, size_t count, | |||
196 | kfree(device_packet); | 196 | kfree(device_packet); |
197 | 197 | ||
198 | if (error) | 198 | if (error) |
199 | return error; | 199 | return -EFAULT; |
200 | 200 | ||
201 | return sizeof(struct icmp_packet); | 201 | return sizeof(struct icmp_packet); |
202 | } | 202 | } |
diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c index 36a254cd4413..39d112b708e3 100644 --- a/drivers/staging/comedi/drivers/adl_pci9111.c +++ b/drivers/staging/comedi/drivers/adl_pci9111.c | |||
@@ -824,9 +824,12 @@ static int pci9111_ai_do_cmd(struct comedi_device *dev, | |||
824 | plx9050_interrupt_control(dev_private->lcr_io_base, true, true, | 824 | plx9050_interrupt_control(dev_private->lcr_io_base, true, true, |
825 | false, true, true); | 825 | false, true, true); |
826 | 826 | ||
827 | dev_private->scan_delay = | 827 | if (async_cmd->scan_begin_src == TRIG_TIMER) { |
828 | (async_cmd->scan_begin_arg / (async_cmd->convert_arg * | 828 | dev_private->scan_delay = |
829 | async_cmd->chanlist_len)) - 1; | 829 | (async_cmd->scan_begin_arg / |
830 | (async_cmd->convert_arg * | ||
831 | async_cmd->chanlist_len)) - 1; | ||
832 | } | ||
830 | 833 | ||
831 | break; | 834 | break; |
832 | 835 | ||
diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c index 81829d6fd287..c374bee25068 100644 --- a/drivers/staging/comedi/drivers/cb_pcidda.c +++ b/drivers/staging/comedi/drivers/cb_pcidda.c | |||
@@ -52,7 +52,6 @@ Please report success/failure with other different cards to | |||
52 | #include "8255.h" | 52 | #include "8255.h" |
53 | 53 | ||
54 | #define PCI_VENDOR_ID_CB 0x1307 /* PCI vendor number of ComputerBoards */ | 54 | #define PCI_VENDOR_ID_CB 0x1307 /* PCI vendor number of ComputerBoards */ |
55 | #define N_BOARDS 10 /* Number of boards in cb_pcidda_boards */ | ||
56 | #define EEPROM_SIZE 128 /* number of entries in eeprom */ | 55 | #define EEPROM_SIZE 128 /* number of entries in eeprom */ |
57 | #define MAX_AO_CHANNELS 8 /* maximum number of ao channels for supported boards */ | 56 | #define MAX_AO_CHANNELS 8 /* maximum number of ao channels for supported boards */ |
58 | 57 | ||
@@ -307,7 +306,7 @@ static int cb_pcidda_attach(struct comedi_device *dev, | |||
307 | continue; | 306 | continue; |
308 | } | 307 | } |
309 | } | 308 | } |
310 | for (index = 0; index < N_BOARDS; index++) { | 309 | for (index = 0; index < ARRAY_SIZE(cb_pcidda_boards); index++) { |
311 | if (cb_pcidda_boards[index].device_id == | 310 | if (cb_pcidda_boards[index].device_id == |
312 | pcidev->device) { | 311 | pcidev->device) { |
313 | goto found; | 312 | goto found; |
diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c index 3f53b4d1e4cf..12db555a3a5d 100644 --- a/drivers/staging/hv/channel_mgmt.c +++ b/drivers/staging/hv/channel_mgmt.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/list.h> | 24 | #include <linux/list.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/completion.h> | ||
26 | #include "osd.h" | 27 | #include "osd.h" |
27 | #include "logging.h" | 28 | #include "logging.h" |
28 | #include "vmbus_private.h" | 29 | #include "vmbus_private.h" |
@@ -293,6 +294,25 @@ void FreeVmbusChannel(struct vmbus_channel *Channel) | |||
293 | Channel); | 294 | Channel); |
294 | } | 295 | } |
295 | 296 | ||
297 | |||
298 | DECLARE_COMPLETION(hv_channel_ready); | ||
299 | |||
300 | /* | ||
301 | * Count initialized channels, and ensure all channels are ready when hv_vmbus | ||
302 | * module loading completes. | ||
303 | */ | ||
304 | static void count_hv_channel(void) | ||
305 | { | ||
306 | static int counter; | ||
307 | unsigned long flags; | ||
308 | |||
309 | spin_lock_irqsave(&gVmbusConnection.channel_lock, flags); | ||
310 | if (++counter == MAX_MSG_TYPES) | ||
311 | complete(&hv_channel_ready); | ||
312 | spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags); | ||
313 | } | ||
314 | |||
315 | |||
296 | /* | 316 | /* |
297 | * VmbusChannelProcessOffer - Process the offer by creating a channel/device | 317 | * VmbusChannelProcessOffer - Process the offer by creating a channel/device |
298 | * associated with this offer | 318 | * associated with this offer |
@@ -373,22 +393,21 @@ static void VmbusChannelProcessOffer(void *context) | |||
373 | * can cleanup properly | 393 | * can cleanup properly |
374 | */ | 394 | */ |
375 | newChannel->State = CHANNEL_OPEN_STATE; | 395 | newChannel->State = CHANNEL_OPEN_STATE; |
376 | cnt = 0; | ||
377 | 396 | ||
378 | while (cnt != MAX_MSG_TYPES) { | 397 | /* Open IC channels */ |
398 | for (cnt = 0; cnt < MAX_MSG_TYPES; cnt++) { | ||
379 | if (memcmp(&newChannel->OfferMsg.Offer.InterfaceType, | 399 | if (memcmp(&newChannel->OfferMsg.Offer.InterfaceType, |
380 | &hv_cb_utils[cnt].data, | 400 | &hv_cb_utils[cnt].data, |
381 | sizeof(struct hv_guid)) == 0) { | 401 | sizeof(struct hv_guid)) == 0 && |
402 | VmbusChannelOpen(newChannel, 2 * PAGE_SIZE, | ||
403 | 2 * PAGE_SIZE, NULL, 0, | ||
404 | hv_cb_utils[cnt].callback, | ||
405 | newChannel) == 0) { | ||
406 | hv_cb_utils[cnt].channel = newChannel; | ||
382 | DPRINT_INFO(VMBUS, "%s", | 407 | DPRINT_INFO(VMBUS, "%s", |
383 | hv_cb_utils[cnt].log_msg); | 408 | hv_cb_utils[cnt].log_msg); |
384 | 409 | count_hv_channel(); | |
385 | if (VmbusChannelOpen(newChannel, 2 * PAGE_SIZE, | ||
386 | 2 * PAGE_SIZE, NULL, 0, | ||
387 | hv_cb_utils[cnt].callback, | ||
388 | newChannel) == 0) | ||
389 | hv_cb_utils[cnt].channel = newChannel; | ||
390 | } | 410 | } |
391 | cnt++; | ||
392 | } | 411 | } |
393 | } | 412 | } |
394 | DPRINT_EXIT(VMBUS); | 413 | DPRINT_EXIT(VMBUS); |
diff --git a/drivers/staging/hv/hv_utils.c b/drivers/staging/hv/hv_utils.c index 8a49aafea37a..2adc9b48ca9c 100644 --- a/drivers/staging/hv/hv_utils.c +++ b/drivers/staging/hv/hv_utils.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/sysctl.h> | 25 | #include <linux/sysctl.h> |
26 | #include <linux/reboot.h> | 26 | #include <linux/reboot.h> |
27 | #include <linux/dmi.h> | ||
28 | #include <linux/pci.h> | ||
27 | 29 | ||
28 | #include "logging.h" | 30 | #include "logging.h" |
29 | #include "osd.h" | 31 | #include "osd.h" |
@@ -251,10 +253,36 @@ static void heartbeat_onchannelcallback(void *context) | |||
251 | DPRINT_EXIT(VMBUS); | 253 | DPRINT_EXIT(VMBUS); |
252 | } | 254 | } |
253 | 255 | ||
256 | static const struct pci_device_id __initconst | ||
257 | hv_utils_pci_table[] __maybe_unused = { | ||
258 | { PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */ | ||
259 | { 0 } | ||
260 | }; | ||
261 | MODULE_DEVICE_TABLE(pci, hv_utils_pci_table); | ||
262 | |||
263 | |||
264 | static const struct dmi_system_id __initconst | ||
265 | hv_utils_dmi_table[] __maybe_unused = { | ||
266 | { | ||
267 | .ident = "Hyper-V", | ||
268 | .matches = { | ||
269 | DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), | ||
270 | DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"), | ||
271 | DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"), | ||
272 | }, | ||
273 | }, | ||
274 | { }, | ||
275 | }; | ||
276 | MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table); | ||
277 | |||
278 | |||
254 | static int __init init_hyperv_utils(void) | 279 | static int __init init_hyperv_utils(void) |
255 | { | 280 | { |
256 | printk(KERN_INFO "Registering HyperV Utility Driver\n"); | 281 | printk(KERN_INFO "Registering HyperV Utility Driver\n"); |
257 | 282 | ||
283 | if (!dmi_check_system(hv_utils_dmi_table)) | ||
284 | return -ENODEV; | ||
285 | |||
258 | hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback = | 286 | hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback = |
259 | &shutdown_onchannelcallback; | 287 | &shutdown_onchannelcallback; |
260 | hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback; | 288 | hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback; |
diff --git a/drivers/staging/hv/vmbus.h b/drivers/staging/hv/vmbus.h index 0c6ee0f487f3..3c14b2926e00 100644 --- a/drivers/staging/hv/vmbus.h +++ b/drivers/staging/hv/vmbus.h | |||
@@ -74,4 +74,6 @@ int vmbus_child_driver_register(struct driver_context *driver_ctx); | |||
74 | void vmbus_child_driver_unregister(struct driver_context *driver_ctx); | 74 | void vmbus_child_driver_unregister(struct driver_context *driver_ctx); |
75 | void vmbus_get_interface(struct vmbus_channel_interface *interface); | 75 | void vmbus_get_interface(struct vmbus_channel_interface *interface); |
76 | 76 | ||
77 | extern struct completion hv_channel_ready; | ||
78 | |||
77 | #endif /* _VMBUS_H_ */ | 79 | #endif /* _VMBUS_H_ */ |
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index c21731a12ca7..22c80ece6388 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/pci.h> | 27 | #include <linux/pci.h> |
28 | #include <linux/dmi.h> | 28 | #include <linux/dmi.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/completion.h> | ||
30 | #include "version_info.h" | 31 | #include "version_info.h" |
31 | #include "osd.h" | 32 | #include "osd.h" |
32 | #include "logging.h" | 33 | #include "logging.h" |
@@ -356,6 +357,8 @@ static int vmbus_bus_init(int (*drv_init)(struct hv_driver *drv)) | |||
356 | 357 | ||
357 | vmbus_drv_obj->GetChannelOffers(); | 358 | vmbus_drv_obj->GetChannelOffers(); |
358 | 359 | ||
360 | wait_for_completion(&hv_channel_ready); | ||
361 | |||
359 | cleanup: | 362 | cleanup: |
360 | DPRINT_EXIT(VMBUS_DRV); | 363 | DPRINT_EXIT(VMBUS_DRV); |
361 | 364 | ||
diff --git a/drivers/staging/mrst-touchscreen/intel-mid-touch.c b/drivers/staging/mrst-touchscreen/intel-mid-touch.c index 1db00975a594..abba22f921be 100644 --- a/drivers/staging/mrst-touchscreen/intel-mid-touch.c +++ b/drivers/staging/mrst-touchscreen/intel-mid-touch.c | |||
@@ -817,9 +817,9 @@ static int mrstouch_remove(struct spi_device *spi) | |||
817 | free_irq(mrstouchdevp->irq, mrstouchdevp); | 817 | free_irq(mrstouchdevp->irq, mrstouchdevp); |
818 | input_unregister_device(mrstouchdevp->input); | 818 | input_unregister_device(mrstouchdevp->input); |
819 | input_free_device(mrstouchdevp->input); | 819 | input_free_device(mrstouchdevp->input); |
820 | kfree(mrstouchdevp); | ||
821 | if (mrstouchdevp->pendet_thrd) | 820 | if (mrstouchdevp->pendet_thrd) |
822 | kthread_stop(mrstouchdevp->pendet_thrd); | 821 | kthread_stop(mrstouchdevp->pendet_thrd); |
822 | kfree(mrstouchdevp); | ||
823 | return 0; | 823 | return 0; |
824 | } | 824 | } |
825 | 825 | ||
diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index b740662d095a..674769d2b59b 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c | |||
@@ -77,6 +77,7 @@ struct usb_device_id rtusb_usb_id[] = { | |||
77 | {USB_DEVICE(0x083A, 0x7522)}, /* Arcadyan */ | 77 | {USB_DEVICE(0x083A, 0x7522)}, /* Arcadyan */ |
78 | {USB_DEVICE(0x0CDE, 0x0022)}, /* ZCOM */ | 78 | {USB_DEVICE(0x0CDE, 0x0022)}, /* ZCOM */ |
79 | {USB_DEVICE(0x0586, 0x3416)}, /* Zyxel */ | 79 | {USB_DEVICE(0x0586, 0x3416)}, /* Zyxel */ |
80 | {USB_DEVICE(0x0586, 0x341a)}, /* Zyxel NWD-270N */ | ||
80 | {USB_DEVICE(0x0CDE, 0x0025)}, /* Zyxel */ | 81 | {USB_DEVICE(0x0CDE, 0x0025)}, /* Zyxel */ |
81 | {USB_DEVICE(0x1740, 0x9701)}, /* EnGenius */ | 82 | {USB_DEVICE(0x1740, 0x9701)}, /* EnGenius */ |
82 | {USB_DEVICE(0x1740, 0x9702)}, /* EnGenius */ | 83 | {USB_DEVICE(0x1740, 0x9702)}, /* EnGenius */ |
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index dacefea78113..49ab9fa9ffa7 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c | |||
@@ -66,8 +66,6 @@ static int hwseqnum = 0; | |||
66 | static int hwwep = 0; | 66 | static int hwwep = 0; |
67 | static int channels = 0x3fff; | 67 | static int channels = 0x3fff; |
68 | 68 | ||
69 | #define eqMacAddr(a, b) (((a)[0] == (b)[0] && (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0) | ||
70 | #define cpMacAddr(des, src) ((des)[0] = (src)[0], (des)[1] = (src)[1], (des)[2] = (src)[2], (des)[3] = (src)[3], (des)[4] = (src)[4], (des)[5] = (src)[5]) | ||
71 | MODULE_LICENSE("GPL"); | 69 | MODULE_LICENSE("GPL"); |
72 | MODULE_DEVICE_TABLE(pci, rtl8180_pci_id_tbl); | 70 | MODULE_DEVICE_TABLE(pci, rtl8180_pci_id_tbl); |
73 | MODULE_AUTHOR("Andrea Merello <andreamrl@tiscali.it>"); | 71 | MODULE_AUTHOR("Andrea Merello <andreamrl@tiscali.it>"); |
diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c index 447d6474a70c..1b6890611fb6 100644 --- a/drivers/staging/rtl8192su/r8192U_core.c +++ b/drivers/staging/rtl8192su/r8192U_core.c | |||
@@ -112,28 +112,29 @@ u32 rt_global_debug_component = \ | |||
112 | #define CAM_CONTENT_COUNT 8 | 112 | #define CAM_CONTENT_COUNT 8 |
113 | 113 | ||
114 | static const struct usb_device_id rtl8192_usb_id_tbl[] = { | 114 | static const struct usb_device_id rtl8192_usb_id_tbl[] = { |
115 | /* Realtek */ | 115 | {USB_DEVICE(0x0bda, 0x8171)}, /* Realtek */ |
116 | {USB_DEVICE(0x0bda, 0x8171)}, | ||
117 | {USB_DEVICE(0x0bda, 0x8192)}, | ||
118 | {USB_DEVICE(0x0bda, 0x8709)}, | ||
119 | /* Corega */ | ||
120 | {USB_DEVICE(0x07aa, 0x0043)}, | ||
121 | /* Belkin */ | ||
122 | {USB_DEVICE(0x050d, 0x805E)}, | ||
123 | {USB_DEVICE(0x050d, 0x815F)}, /* Belkin F5D8053 v6 */ | ||
124 | /* Sitecom */ | ||
125 | {USB_DEVICE(0x0df6, 0x0031)}, | ||
126 | {USB_DEVICE(0x0df6, 0x004b)}, /* WL-349 */ | ||
127 | /* EnGenius */ | ||
128 | {USB_DEVICE(0x1740, 0x9201)}, | ||
129 | /* Dlink */ | ||
130 | {USB_DEVICE(0x2001, 0x3301)}, | ||
131 | /* Zinwell */ | ||
132 | {USB_DEVICE(0x5a57, 0x0290)}, | ||
133 | /* Guillemot */ | ||
134 | {USB_DEVICE(0x06f8, 0xe031)}, | ||
135 | //92SU | ||
136 | {USB_DEVICE(0x0bda, 0x8172)}, | 116 | {USB_DEVICE(0x0bda, 0x8172)}, |
117 | {USB_DEVICE(0x0bda, 0x8173)}, | ||
118 | {USB_DEVICE(0x0bda, 0x8174)}, | ||
119 | {USB_DEVICE(0x0bda, 0x8712)}, | ||
120 | {USB_DEVICE(0x0bda, 0x8713)}, | ||
121 | {USB_DEVICE(0x07aa, 0x0047)}, | ||
122 | {USB_DEVICE(0x07d1, 0x3303)}, | ||
123 | {USB_DEVICE(0x07d1, 0x3302)}, | ||
124 | {USB_DEVICE(0x07d1, 0x3300)}, | ||
125 | {USB_DEVICE(0x1740, 0x9603)}, | ||
126 | {USB_DEVICE(0x1740, 0x9605)}, | ||
127 | {USB_DEVICE(0x050d, 0x815F)}, | ||
128 | {USB_DEVICE(0x06f8, 0xe031)}, | ||
129 | {USB_DEVICE(0x7392, 0x7611)}, | ||
130 | {USB_DEVICE(0x7392, 0x7612)}, | ||
131 | {USB_DEVICE(0x7392, 0x7622)}, | ||
132 | {USB_DEVICE(0x0DF6, 0x0045)}, | ||
133 | {USB_DEVICE(0x0E66, 0x0015)}, | ||
134 | {USB_DEVICE(0x0E66, 0x0016)}, | ||
135 | {USB_DEVICE(0x0b05, 0x1786)}, | ||
136 | /* these are not in the official list */ | ||
137 | {USB_DEVICE(0x0df6, 0x004b)}, /* WL-349 */ | ||
137 | {} | 138 | {} |
138 | }; | 139 | }; |
139 | 140 | ||
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 2bede271a2f0..f38472c2e75c 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c | |||
@@ -121,6 +121,8 @@ static const struct usb_device_id rtl8192_usb_id_tbl[] = { | |||
121 | {USB_DEVICE(0x2001, 0x3301)}, | 121 | {USB_DEVICE(0x2001, 0x3301)}, |
122 | /* Zinwell */ | 122 | /* Zinwell */ |
123 | {USB_DEVICE(0x5a57, 0x0290)}, | 123 | {USB_DEVICE(0x5a57, 0x0290)}, |
124 | /* LG */ | ||
125 | {USB_DEVICE(0x043e, 0x7a01)}, | ||
124 | {} | 126 | {} |
125 | }; | 127 | }; |
126 | 128 | ||
diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c index 52408164036f..6a499f0eb594 100644 --- a/drivers/staging/usbip/usbip_common.c +++ b/drivers/staging/usbip/usbip_common.c | |||
@@ -378,47 +378,67 @@ int usbip_thread(void *param) | |||
378 | complete_and_exit(&ut->thread_done, 0); | 378 | complete_and_exit(&ut->thread_done, 0); |
379 | } | 379 | } |
380 | 380 | ||
381 | static void stop_rx_thread(struct usbip_device *ud) | ||
382 | { | ||
383 | if (ud->tcp_rx.thread != NULL) { | ||
384 | send_sig(SIGKILL, ud->tcp_rx.thread, 1); | ||
385 | wait_for_completion(&ud->tcp_rx.thread_done); | ||
386 | usbip_udbg("rx_thread for ud %p has finished\n", ud); | ||
387 | } | ||
388 | } | ||
389 | |||
390 | static void stop_tx_thread(struct usbip_device *ud) | ||
391 | { | ||
392 | if (ud->tcp_tx.thread != NULL) { | ||
393 | send_sig(SIGKILL, ud->tcp_tx.thread, 1); | ||
394 | wait_for_completion(&ud->tcp_tx.thread_done); | ||
395 | usbip_udbg("tx_thread for ud %p has finished\n", ud); | ||
396 | } | ||
397 | } | ||
398 | |||
381 | int usbip_start_threads(struct usbip_device *ud) | 399 | int usbip_start_threads(struct usbip_device *ud) |
382 | { | 400 | { |
383 | /* | 401 | /* |
384 | * threads are invoked per one device (per one connection). | 402 | * threads are invoked per one device (per one connection). |
385 | */ | 403 | */ |
386 | struct task_struct *th; | 404 | struct task_struct *th; |
405 | int err = 0; | ||
387 | 406 | ||
388 | th = kthread_run(usbip_thread, (void *)&ud->tcp_rx, "usbip"); | 407 | th = kthread_run(usbip_thread, (void *)&ud->tcp_rx, "usbip"); |
389 | if (IS_ERR(th)) { | 408 | if (IS_ERR(th)) { |
390 | printk(KERN_WARNING | 409 | printk(KERN_WARNING |
391 | "Unable to start control thread\n"); | 410 | "Unable to start control thread\n"); |
392 | return PTR_ERR(th); | 411 | err = PTR_ERR(th); |
412 | goto ust_exit; | ||
393 | } | 413 | } |
414 | |||
394 | th = kthread_run(usbip_thread, (void *)&ud->tcp_tx, "usbip"); | 415 | th = kthread_run(usbip_thread, (void *)&ud->tcp_tx, "usbip"); |
395 | if (IS_ERR(th)) { | 416 | if (IS_ERR(th)) { |
396 | printk(KERN_WARNING | 417 | printk(KERN_WARNING |
397 | "Unable to start control thread\n"); | 418 | "Unable to start control thread\n"); |
398 | return PTR_ERR(th); | 419 | err = PTR_ERR(th); |
420 | goto tx_thread_err; | ||
399 | } | 421 | } |
400 | 422 | ||
401 | /* confirm threads are starting */ | 423 | /* confirm threads are starting */ |
402 | wait_for_completion(&ud->tcp_rx.thread_done); | 424 | wait_for_completion(&ud->tcp_rx.thread_done); |
403 | wait_for_completion(&ud->tcp_tx.thread_done); | 425 | wait_for_completion(&ud->tcp_tx.thread_done); |
426 | |||
404 | return 0; | 427 | return 0; |
428 | |||
429 | tx_thread_err: | ||
430 | stop_rx_thread(ud); | ||
431 | |||
432 | ust_exit: | ||
433 | return err; | ||
405 | } | 434 | } |
406 | EXPORT_SYMBOL_GPL(usbip_start_threads); | 435 | EXPORT_SYMBOL_GPL(usbip_start_threads); |
407 | 436 | ||
408 | void usbip_stop_threads(struct usbip_device *ud) | 437 | void usbip_stop_threads(struct usbip_device *ud) |
409 | { | 438 | { |
410 | /* kill threads related to this sdev, if v.c. exists */ | 439 | /* kill threads related to this sdev, if v.c. exists */ |
411 | if (ud->tcp_rx.thread != NULL) { | 440 | stop_rx_thread(ud); |
412 | send_sig(SIGKILL, ud->tcp_rx.thread, 1); | 441 | stop_tx_thread(ud); |
413 | wait_for_completion(&ud->tcp_rx.thread_done); | ||
414 | usbip_udbg("rx_thread for ud %p has finished\n", ud); | ||
415 | } | ||
416 | |||
417 | if (ud->tcp_tx.thread != NULL) { | ||
418 | send_sig(SIGKILL, ud->tcp_tx.thread, 1); | ||
419 | wait_for_completion(&ud->tcp_tx.thread_done); | ||
420 | usbip_udbg("tx_thread for ud %p has finished\n", ud); | ||
421 | } | ||
422 | } | 442 | } |
423 | EXPORT_SYMBOL_GPL(usbip_stop_threads); | 443 | EXPORT_SYMBOL_GPL(usbip_stop_threads); |
424 | 444 | ||
diff --git a/drivers/staging/wlags49_h2/wl_enc.c b/drivers/staging/wlags49_h2/wl_enc.c index 48c44c8fdb28..26cf5486edd6 100644 --- a/drivers/staging/wlags49_h2/wl_enc.c +++ b/drivers/staging/wlags49_h2/wl_enc.c | |||
@@ -62,6 +62,7 @@ | |||
62 | /******************************************************************************* | 62 | /******************************************************************************* |
63 | * include files | 63 | * include files |
64 | ******************************************************************************/ | 64 | ******************************************************************************/ |
65 | #include <linux/string.h> | ||
65 | #include <wl_version.h> | 66 | #include <wl_version.h> |
66 | 67 | ||
67 | #include <debug.h> | 68 | #include <debug.h> |
diff --git a/drivers/staging/wlags49_h2/wl_sysfs.h b/drivers/staging/wlags49_h2/wl_sysfs.h index 6d96d03cf490..fa658c38001e 100644 --- a/drivers/staging/wlags49_h2/wl_sysfs.h +++ b/drivers/staging/wlags49_h2/wl_sysfs.h | |||
@@ -2,6 +2,6 @@ | |||
2 | extern void register_wlags_sysfs(struct net_device *); | 2 | extern void register_wlags_sysfs(struct net_device *); |
3 | extern void unregister_wlags_sysfs(struct net_device *); | 3 | extern void unregister_wlags_sysfs(struct net_device *); |
4 | #else | 4 | #else |
5 | static void register_wlags_sysfs(struct net_device *) { return; }; | 5 | static inline void register_wlags_sysfs(struct net_device *net) { } |
6 | static void unregister_wlags_sysfs(struct net_device *) { return; }; | 6 | static inline void unregister_wlags_sysfs(struct net_device *net) { } |
7 | #endif | 7 | #endif |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index de98a94d1853..a6bd53ace035 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -1272,8 +1272,7 @@ static int usb_resume_both(struct usb_device *udev, pm_message_t msg) | |||
1272 | 1272 | ||
1273 | static void choose_wakeup(struct usb_device *udev, pm_message_t msg) | 1273 | static void choose_wakeup(struct usb_device *udev, pm_message_t msg) |
1274 | { | 1274 | { |
1275 | int w, i; | 1275 | int w; |
1276 | struct usb_interface *intf; | ||
1277 | 1276 | ||
1278 | /* Remote wakeup is needed only when we actually go to sleep. | 1277 | /* Remote wakeup is needed only when we actually go to sleep. |
1279 | * For things like FREEZE and QUIESCE, if the device is already | 1278 | * For things like FREEZE and QUIESCE, if the device is already |
@@ -1285,16 +1284,10 @@ static void choose_wakeup(struct usb_device *udev, pm_message_t msg) | |||
1285 | return; | 1284 | return; |
1286 | } | 1285 | } |
1287 | 1286 | ||
1288 | /* If remote wakeup is permitted, see whether any interface drivers | 1287 | /* Enable remote wakeup if it is allowed, even if no interface drivers |
1289 | * actually want it. | 1288 | * actually want it. |
1290 | */ | 1289 | */ |
1291 | w = 0; | 1290 | w = device_may_wakeup(&udev->dev); |
1292 | if (device_may_wakeup(&udev->dev) && udev->actconfig) { | ||
1293 | for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { | ||
1294 | intf = udev->actconfig->interface[i]; | ||
1295 | w |= intf->needs_remote_wakeup; | ||
1296 | } | ||
1297 | } | ||
1298 | 1291 | ||
1299 | /* If the device is autosuspended with the wrong wakeup setting, | 1292 | /* If the device is autosuspended with the wrong wakeup setting, |
1300 | * autoresume now so the setting can be changed. | 1293 | * autoresume now so the setting can be changed. |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index a73e08fdab36..fd4c36ea5e46 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -416,8 +416,11 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, | |||
416 | /* A length of zero means transfer the whole sg list */ | 416 | /* A length of zero means transfer the whole sg list */ |
417 | len = length; | 417 | len = length; |
418 | if (len == 0) { | 418 | if (len == 0) { |
419 | for_each_sg(sg, sg, nents, i) | 419 | struct scatterlist *sg2; |
420 | len += sg->length; | 420 | int j; |
421 | |||
422 | for_each_sg(sg, sg2, nents, j) | ||
423 | len += sg2->length; | ||
421 | } | 424 | } |
422 | } else { | 425 | } else { |
423 | /* | 426 | /* |
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c index 38226e9a371d..95dd4662d6a8 100644 --- a/drivers/usb/gadget/f_eem.c +++ b/drivers/usb/gadget/f_eem.c | |||
@@ -469,8 +469,7 @@ static int eem_unwrap(struct gether *port, | |||
469 | crc = get_unaligned_le32(skb->data + len | 469 | crc = get_unaligned_le32(skb->data + len |
470 | - ETH_FCS_LEN); | 470 | - ETH_FCS_LEN); |
471 | crc2 = ~crc32_le(~0, | 471 | crc2 = ~crc32_le(~0, |
472 | skb->data, | 472 | skb->data, len - ETH_FCS_LEN); |
473 | skb->len - ETH_FCS_LEN); | ||
474 | } else { | 473 | } else { |
475 | crc = get_unaligned_be32(skb->data + len | 474 | crc = get_unaligned_be32(skb->data + len |
476 | - ETH_FCS_LEN); | 475 | - ETH_FCS_LEN); |
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 7d05a0be5c60..4ce899c9b165 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c | |||
@@ -321,8 +321,8 @@ struct fsg_dev; | |||
321 | /* Data shared by all the FSG instances. */ | 321 | /* Data shared by all the FSG instances. */ |
322 | struct fsg_common { | 322 | struct fsg_common { |
323 | struct usb_gadget *gadget; | 323 | struct usb_gadget *gadget; |
324 | struct fsg_dev *fsg; | 324 | struct fsg_dev *fsg, *new_fsg; |
325 | struct fsg_dev *prev_fsg; | 325 | wait_queue_head_t fsg_wait; |
326 | 326 | ||
327 | /* filesem protects: backing files in use */ | 327 | /* filesem protects: backing files in use */ |
328 | struct rw_semaphore filesem; | 328 | struct rw_semaphore filesem; |
@@ -351,7 +351,6 @@ struct fsg_common { | |||
351 | enum fsg_state state; /* For exception handling */ | 351 | enum fsg_state state; /* For exception handling */ |
352 | unsigned int exception_req_tag; | 352 | unsigned int exception_req_tag; |
353 | 353 | ||
354 | u8 config, new_config; | ||
355 | enum data_direction data_dir; | 354 | enum data_direction data_dir; |
356 | u32 data_size; | 355 | u32 data_size; |
357 | u32 data_size_from_cmnd; | 356 | u32 data_size_from_cmnd; |
@@ -595,7 +594,7 @@ static int fsg_setup(struct usb_function *f, | |||
595 | u16 w_value = le16_to_cpu(ctrl->wValue); | 594 | u16 w_value = le16_to_cpu(ctrl->wValue); |
596 | u16 w_length = le16_to_cpu(ctrl->wLength); | 595 | u16 w_length = le16_to_cpu(ctrl->wLength); |
597 | 596 | ||
598 | if (!fsg->common->config) | 597 | if (!fsg_is_set(fsg->common)) |
599 | return -EOPNOTSUPP; | 598 | return -EOPNOTSUPP; |
600 | 599 | ||
601 | switch (ctrl->bRequest) { | 600 | switch (ctrl->bRequest) { |
@@ -2303,24 +2302,20 @@ static int alloc_request(struct fsg_common *common, struct usb_ep *ep, | |||
2303 | return -ENOMEM; | 2302 | return -ENOMEM; |
2304 | } | 2303 | } |
2305 | 2304 | ||
2306 | /* | 2305 | /* Reset interface setting and re-init endpoint state (toggle etc). */ |
2307 | * Reset interface setting and re-init endpoint state (toggle etc). | 2306 | static int do_set_interface(struct fsg_common *common, struct fsg_dev *new_fsg) |
2308 | * Call with altsetting < 0 to disable the interface. The only other | ||
2309 | * available altsetting is 0, which enables the interface. | ||
2310 | */ | ||
2311 | static int do_set_interface(struct fsg_common *common, int altsetting) | ||
2312 | { | 2307 | { |
2313 | int rc = 0; | 2308 | const struct usb_endpoint_descriptor *d; |
2314 | int i; | 2309 | struct fsg_dev *fsg; |
2315 | const struct usb_endpoint_descriptor *d; | 2310 | int i, rc = 0; |
2316 | 2311 | ||
2317 | if (common->running) | 2312 | if (common->running) |
2318 | DBG(common, "reset interface\n"); | 2313 | DBG(common, "reset interface\n"); |
2319 | 2314 | ||
2320 | reset: | 2315 | reset: |
2321 | /* Deallocate the requests */ | 2316 | /* Deallocate the requests */ |
2322 | if (common->prev_fsg) { | 2317 | if (common->fsg) { |
2323 | struct fsg_dev *fsg = common->prev_fsg; | 2318 | fsg = common->fsg; |
2324 | 2319 | ||
2325 | for (i = 0; i < FSG_NUM_BUFFERS; ++i) { | 2320 | for (i = 0; i < FSG_NUM_BUFFERS; ++i) { |
2326 | struct fsg_buffhd *bh = &common->buffhds[i]; | 2321 | struct fsg_buffhd *bh = &common->buffhds[i]; |
@@ -2345,88 +2340,53 @@ reset: | |||
2345 | fsg->bulk_out_enabled = 0; | 2340 | fsg->bulk_out_enabled = 0; |
2346 | } | 2341 | } |
2347 | 2342 | ||
2348 | common->prev_fsg = 0; | 2343 | common->fsg = NULL; |
2344 | wake_up(&common->fsg_wait); | ||
2349 | } | 2345 | } |
2350 | 2346 | ||
2351 | common->running = 0; | 2347 | common->running = 0; |
2352 | if (altsetting < 0 || rc != 0) | 2348 | if (!new_fsg || rc) |
2353 | return rc; | 2349 | return rc; |
2354 | 2350 | ||
2355 | DBG(common, "set interface %d\n", altsetting); | 2351 | common->fsg = new_fsg; |
2352 | fsg = common->fsg; | ||
2356 | 2353 | ||
2357 | if (fsg_is_set(common)) { | 2354 | /* Enable the endpoints */ |
2358 | struct fsg_dev *fsg = common->fsg; | 2355 | d = fsg_ep_desc(common->gadget, |
2359 | common->prev_fsg = common->fsg; | 2356 | &fsg_fs_bulk_in_desc, &fsg_hs_bulk_in_desc); |
2357 | rc = enable_endpoint(common, fsg->bulk_in, d); | ||
2358 | if (rc) | ||
2359 | goto reset; | ||
2360 | fsg->bulk_in_enabled = 1; | ||
2361 | |||
2362 | d = fsg_ep_desc(common->gadget, | ||
2363 | &fsg_fs_bulk_out_desc, &fsg_hs_bulk_out_desc); | ||
2364 | rc = enable_endpoint(common, fsg->bulk_out, d); | ||
2365 | if (rc) | ||
2366 | goto reset; | ||
2367 | fsg->bulk_out_enabled = 1; | ||
2368 | common->bulk_out_maxpacket = le16_to_cpu(d->wMaxPacketSize); | ||
2369 | clear_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags); | ||
2360 | 2370 | ||
2361 | /* Enable the endpoints */ | 2371 | /* Allocate the requests */ |
2362 | d = fsg_ep_desc(common->gadget, | 2372 | for (i = 0; i < FSG_NUM_BUFFERS; ++i) { |
2363 | &fsg_fs_bulk_in_desc, &fsg_hs_bulk_in_desc); | 2373 | struct fsg_buffhd *bh = &common->buffhds[i]; |
2364 | rc = enable_endpoint(common, fsg->bulk_in, d); | 2374 | |
2375 | rc = alloc_request(common, fsg->bulk_in, &bh->inreq); | ||
2365 | if (rc) | 2376 | if (rc) |
2366 | goto reset; | 2377 | goto reset; |
2367 | fsg->bulk_in_enabled = 1; | 2378 | rc = alloc_request(common, fsg->bulk_out, &bh->outreq); |
2368 | |||
2369 | d = fsg_ep_desc(common->gadget, | ||
2370 | &fsg_fs_bulk_out_desc, &fsg_hs_bulk_out_desc); | ||
2371 | rc = enable_endpoint(common, fsg->bulk_out, d); | ||
2372 | if (rc) | 2379 | if (rc) |
2373 | goto reset; | 2380 | goto reset; |
2374 | fsg->bulk_out_enabled = 1; | 2381 | bh->inreq->buf = bh->outreq->buf = bh->buf; |
2375 | common->bulk_out_maxpacket = le16_to_cpu(d->wMaxPacketSize); | 2382 | bh->inreq->context = bh->outreq->context = bh; |
2376 | clear_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags); | 2383 | bh->inreq->complete = bulk_in_complete; |
2377 | 2384 | bh->outreq->complete = bulk_out_complete; | |
2378 | /* Allocate the requests */ | ||
2379 | for (i = 0; i < FSG_NUM_BUFFERS; ++i) { | ||
2380 | struct fsg_buffhd *bh = &common->buffhds[i]; | ||
2381 | |||
2382 | rc = alloc_request(common, fsg->bulk_in, &bh->inreq); | ||
2383 | if (rc) | ||
2384 | goto reset; | ||
2385 | rc = alloc_request(common, fsg->bulk_out, &bh->outreq); | ||
2386 | if (rc) | ||
2387 | goto reset; | ||
2388 | bh->inreq->buf = bh->outreq->buf = bh->buf; | ||
2389 | bh->inreq->context = bh->outreq->context = bh; | ||
2390 | bh->inreq->complete = bulk_in_complete; | ||
2391 | bh->outreq->complete = bulk_out_complete; | ||
2392 | } | ||
2393 | |||
2394 | common->running = 1; | ||
2395 | for (i = 0; i < common->nluns; ++i) | ||
2396 | common->luns[i].unit_attention_data = SS_RESET_OCCURRED; | ||
2397 | return rc; | ||
2398 | } else { | ||
2399 | return -EIO; | ||
2400 | } | ||
2401 | } | ||
2402 | |||
2403 | |||
2404 | /* | ||
2405 | * Change our operational configuration. This code must agree with the code | ||
2406 | * that returns config descriptors, and with interface altsetting code. | ||
2407 | * | ||
2408 | * It's also responsible for power management interactions. Some | ||
2409 | * configurations might not work with our current power sources. | ||
2410 | * For now we just assume the gadget is always self-powered. | ||
2411 | */ | ||
2412 | static int do_set_config(struct fsg_common *common, u8 new_config) | ||
2413 | { | ||
2414 | int rc = 0; | ||
2415 | |||
2416 | /* Disable the single interface */ | ||
2417 | if (common->config != 0) { | ||
2418 | DBG(common, "reset config\n"); | ||
2419 | common->config = 0; | ||
2420 | rc = do_set_interface(common, -1); | ||
2421 | } | 2385 | } |
2422 | 2386 | ||
2423 | /* Enable the interface */ | 2387 | common->running = 1; |
2424 | if (new_config != 0) { | 2388 | for (i = 0; i < common->nluns; ++i) |
2425 | common->config = new_config; | 2389 | common->luns[i].unit_attention_data = SS_RESET_OCCURRED; |
2426 | rc = do_set_interface(common, 0); | ||
2427 | if (rc != 0) | ||
2428 | common->config = 0; /* Reset on errors */ | ||
2429 | } | ||
2430 | return rc; | 2390 | return rc; |
2431 | } | 2391 | } |
2432 | 2392 | ||
@@ -2437,9 +2397,7 @@ static int do_set_config(struct fsg_common *common, u8 new_config) | |||
2437 | static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) | 2397 | static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) |
2438 | { | 2398 | { |
2439 | struct fsg_dev *fsg = fsg_from_func(f); | 2399 | struct fsg_dev *fsg = fsg_from_func(f); |
2440 | fsg->common->prev_fsg = fsg->common->fsg; | 2400 | fsg->common->new_fsg = fsg; |
2441 | fsg->common->fsg = fsg; | ||
2442 | fsg->common->new_config = 1; | ||
2443 | raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE); | 2401 | raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE); |
2444 | return 0; | 2402 | return 0; |
2445 | } | 2403 | } |
@@ -2447,9 +2405,7 @@ static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt) | |||
2447 | static void fsg_disable(struct usb_function *f) | 2405 | static void fsg_disable(struct usb_function *f) |
2448 | { | 2406 | { |
2449 | struct fsg_dev *fsg = fsg_from_func(f); | 2407 | struct fsg_dev *fsg = fsg_from_func(f); |
2450 | fsg->common->prev_fsg = fsg->common->fsg; | 2408 | fsg->common->new_fsg = NULL; |
2451 | fsg->common->fsg = fsg; | ||
2452 | fsg->common->new_config = 0; | ||
2453 | raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE); | 2409 | raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE); |
2454 | } | 2410 | } |
2455 | 2411 | ||
@@ -2459,19 +2415,17 @@ static void fsg_disable(struct usb_function *f) | |||
2459 | static void handle_exception(struct fsg_common *common) | 2415 | static void handle_exception(struct fsg_common *common) |
2460 | { | 2416 | { |
2461 | siginfo_t info; | 2417 | siginfo_t info; |
2462 | int sig; | ||
2463 | int i; | 2418 | int i; |
2464 | struct fsg_buffhd *bh; | 2419 | struct fsg_buffhd *bh; |
2465 | enum fsg_state old_state; | 2420 | enum fsg_state old_state; |
2466 | u8 new_config; | ||
2467 | struct fsg_lun *curlun; | 2421 | struct fsg_lun *curlun; |
2468 | unsigned int exception_req_tag; | 2422 | unsigned int exception_req_tag; |
2469 | int rc; | ||
2470 | 2423 | ||
2471 | /* Clear the existing signals. Anything but SIGUSR1 is converted | 2424 | /* Clear the existing signals. Anything but SIGUSR1 is converted |
2472 | * into a high-priority EXIT exception. */ | 2425 | * into a high-priority EXIT exception. */ |
2473 | for (;;) { | 2426 | for (;;) { |
2474 | sig = dequeue_signal_lock(current, ¤t->blocked, &info); | 2427 | int sig = |
2428 | dequeue_signal_lock(current, ¤t->blocked, &info); | ||
2475 | if (!sig) | 2429 | if (!sig) |
2476 | break; | 2430 | break; |
2477 | if (sig != SIGUSR1) { | 2431 | if (sig != SIGUSR1) { |
@@ -2482,7 +2436,7 @@ static void handle_exception(struct fsg_common *common) | |||
2482 | } | 2436 | } |
2483 | 2437 | ||
2484 | /* Cancel all the pending transfers */ | 2438 | /* Cancel all the pending transfers */ |
2485 | if (fsg_is_set(common)) { | 2439 | if (likely(common->fsg)) { |
2486 | for (i = 0; i < FSG_NUM_BUFFERS; ++i) { | 2440 | for (i = 0; i < FSG_NUM_BUFFERS; ++i) { |
2487 | bh = &common->buffhds[i]; | 2441 | bh = &common->buffhds[i]; |
2488 | if (bh->inreq_busy) | 2442 | if (bh->inreq_busy) |
@@ -2523,7 +2477,6 @@ static void handle_exception(struct fsg_common *common) | |||
2523 | common->next_buffhd_to_fill = &common->buffhds[0]; | 2477 | common->next_buffhd_to_fill = &common->buffhds[0]; |
2524 | common->next_buffhd_to_drain = &common->buffhds[0]; | 2478 | common->next_buffhd_to_drain = &common->buffhds[0]; |
2525 | exception_req_tag = common->exception_req_tag; | 2479 | exception_req_tag = common->exception_req_tag; |
2526 | new_config = common->new_config; | ||
2527 | old_state = common->state; | 2480 | old_state = common->state; |
2528 | 2481 | ||
2529 | if (old_state == FSG_STATE_ABORT_BULK_OUT) | 2482 | if (old_state == FSG_STATE_ABORT_BULK_OUT) |
@@ -2573,12 +2526,12 @@ static void handle_exception(struct fsg_common *common) | |||
2573 | break; | 2526 | break; |
2574 | 2527 | ||
2575 | case FSG_STATE_CONFIG_CHANGE: | 2528 | case FSG_STATE_CONFIG_CHANGE: |
2576 | rc = do_set_config(common, new_config); | 2529 | do_set_interface(common, common->new_fsg); |
2577 | break; | 2530 | break; |
2578 | 2531 | ||
2579 | case FSG_STATE_EXIT: | 2532 | case FSG_STATE_EXIT: |
2580 | case FSG_STATE_TERMINATED: | 2533 | case FSG_STATE_TERMINATED: |
2581 | do_set_config(common, 0); /* Free resources */ | 2534 | do_set_interface(common, NULL); /* Free resources */ |
2582 | spin_lock_irq(&common->lock); | 2535 | spin_lock_irq(&common->lock); |
2583 | common->state = FSG_STATE_TERMINATED; /* Stop the thread */ | 2536 | common->state = FSG_STATE_TERMINATED; /* Stop the thread */ |
2584 | spin_unlock_irq(&common->lock); | 2537 | spin_unlock_irq(&common->lock); |
@@ -2863,6 +2816,7 @@ buffhds_first_it: | |||
2863 | goto error_release; | 2816 | goto error_release; |
2864 | } | 2817 | } |
2865 | init_completion(&common->thread_notifier); | 2818 | init_completion(&common->thread_notifier); |
2819 | init_waitqueue_head(&common->fsg_wait); | ||
2866 | #undef OR | 2820 | #undef OR |
2867 | 2821 | ||
2868 | 2822 | ||
@@ -2957,9 +2911,17 @@ static void fsg_common_release(struct kref *ref) | |||
2957 | static void fsg_unbind(struct usb_configuration *c, struct usb_function *f) | 2911 | static void fsg_unbind(struct usb_configuration *c, struct usb_function *f) |
2958 | { | 2912 | { |
2959 | struct fsg_dev *fsg = fsg_from_func(f); | 2913 | struct fsg_dev *fsg = fsg_from_func(f); |
2914 | struct fsg_common *common = fsg->common; | ||
2960 | 2915 | ||
2961 | DBG(fsg, "unbind\n"); | 2916 | DBG(fsg, "unbind\n"); |
2962 | fsg_common_put(fsg->common); | 2917 | if (fsg->common->fsg == fsg) { |
2918 | fsg->common->new_fsg = NULL; | ||
2919 | raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE); | ||
2920 | /* FIXME: make interruptible or killable somehow? */ | ||
2921 | wait_event(common->fsg_wait, common->fsg != fsg); | ||
2922 | } | ||
2923 | |||
2924 | fsg_common_put(common); | ||
2963 | usb_free_descriptors(fsg->function.descriptors); | 2925 | usb_free_descriptors(fsg->function.descriptors); |
2964 | usb_free_descriptors(fsg->function.hs_descriptors); | 2926 | usb_free_descriptors(fsg->function.hs_descriptors); |
2965 | kfree(fsg); | 2927 | kfree(fsg); |
@@ -2970,7 +2932,6 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f) | |||
2970 | { | 2932 | { |
2971 | struct fsg_dev *fsg = fsg_from_func(f); | 2933 | struct fsg_dev *fsg = fsg_from_func(f); |
2972 | struct usb_gadget *gadget = c->cdev->gadget; | 2934 | struct usb_gadget *gadget = c->cdev->gadget; |
2973 | int rc; | ||
2974 | int i; | 2935 | int i; |
2975 | struct usb_ep *ep; | 2936 | struct usb_ep *ep; |
2976 | 2937 | ||
@@ -2996,6 +2957,11 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f) | |||
2996 | ep->driver_data = fsg->common; /* claim the endpoint */ | 2957 | ep->driver_data = fsg->common; /* claim the endpoint */ |
2997 | fsg->bulk_out = ep; | 2958 | fsg->bulk_out = ep; |
2998 | 2959 | ||
2960 | /* Copy descriptors */ | ||
2961 | f->descriptors = usb_copy_descriptors(fsg_fs_function); | ||
2962 | if (unlikely(!f->descriptors)) | ||
2963 | return -ENOMEM; | ||
2964 | |||
2999 | if (gadget_is_dualspeed(gadget)) { | 2965 | if (gadget_is_dualspeed(gadget)) { |
3000 | /* Assume endpoint addresses are the same for both speeds */ | 2966 | /* Assume endpoint addresses are the same for both speeds */ |
3001 | fsg_hs_bulk_in_desc.bEndpointAddress = | 2967 | fsg_hs_bulk_in_desc.bEndpointAddress = |
@@ -3003,16 +2969,17 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f) | |||
3003 | fsg_hs_bulk_out_desc.bEndpointAddress = | 2969 | fsg_hs_bulk_out_desc.bEndpointAddress = |
3004 | fsg_fs_bulk_out_desc.bEndpointAddress; | 2970 | fsg_fs_bulk_out_desc.bEndpointAddress; |
3005 | f->hs_descriptors = usb_copy_descriptors(fsg_hs_function); | 2971 | f->hs_descriptors = usb_copy_descriptors(fsg_hs_function); |
3006 | if (unlikely(!f->hs_descriptors)) | 2972 | if (unlikely(!f->hs_descriptors)) { |
2973 | usb_free_descriptors(f->descriptors); | ||
3007 | return -ENOMEM; | 2974 | return -ENOMEM; |
2975 | } | ||
3008 | } | 2976 | } |
3009 | 2977 | ||
3010 | return 0; | 2978 | return 0; |
3011 | 2979 | ||
3012 | autoconf_fail: | 2980 | autoconf_fail: |
3013 | ERROR(fsg, "unable to autoconfigure all endpoints\n"); | 2981 | ERROR(fsg, "unable to autoconfigure all endpoints\n"); |
3014 | rc = -ENOTSUPP; | 2982 | return -ENOTSUPP; |
3015 | return rc; | ||
3016 | } | 2983 | } |
3017 | 2984 | ||
3018 | 2985 | ||
@@ -3036,11 +3003,6 @@ static int fsg_add(struct usb_composite_dev *cdev, | |||
3036 | 3003 | ||
3037 | fsg->function.name = FSG_DRIVER_DESC; | 3004 | fsg->function.name = FSG_DRIVER_DESC; |
3038 | fsg->function.strings = fsg_strings_array; | 3005 | fsg->function.strings = fsg_strings_array; |
3039 | fsg->function.descriptors = usb_copy_descriptors(fsg_fs_function); | ||
3040 | if (unlikely(!fsg->function.descriptors)) { | ||
3041 | rc = -ENOMEM; | ||
3042 | goto error_free_fsg; | ||
3043 | } | ||
3044 | fsg->function.bind = fsg_bind; | 3006 | fsg->function.bind = fsg_bind; |
3045 | fsg->function.unbind = fsg_unbind; | 3007 | fsg->function.unbind = fsg_unbind; |
3046 | fsg->function.setup = fsg_setup; | 3008 | fsg->function.setup = fsg_setup; |
@@ -3056,19 +3018,9 @@ static int fsg_add(struct usb_composite_dev *cdev, | |||
3056 | 3018 | ||
3057 | rc = usb_add_function(c, &fsg->function); | 3019 | rc = usb_add_function(c, &fsg->function); |
3058 | if (unlikely(rc)) | 3020 | if (unlikely(rc)) |
3059 | goto error_free_all; | 3021 | kfree(fsg); |
3060 | 3022 | else | |
3061 | fsg_common_get(fsg->common); | 3023 | fsg_common_get(fsg->common); |
3062 | return 0; | ||
3063 | |||
3064 | error_free_all: | ||
3065 | usb_free_descriptors(fsg->function.descriptors); | ||
3066 | /* fsg_bind() might have copied those; or maybe not? who cares | ||
3067 | * -- free it just in case. */ | ||
3068 | usb_free_descriptors(fsg->function.hs_descriptors); | ||
3069 | error_free_fsg: | ||
3070 | kfree(fsg); | ||
3071 | |||
3072 | return rc; | 3024 | return rc; |
3073 | } | 3025 | } |
3074 | 3026 | ||
diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c index 4b0e4a040d6f..d1af253a9105 100644 --- a/drivers/usb/gadget/g_ffs.c +++ b/drivers/usb/gadget/g_ffs.c | |||
@@ -392,6 +392,17 @@ static int __gfs_do_config(struct usb_configuration *c, | |||
392 | if (unlikely(ret < 0)) | 392 | if (unlikely(ret < 0)) |
393 | return ret; | 393 | return ret; |
394 | 394 | ||
395 | /* After previous do_configs there may be some invalid | ||
396 | * pointers in c->interface array. This happens every time | ||
397 | * a user space function with fewer interfaces than a user | ||
398 | * space function that was run before the new one is run. The | ||
399 | * compasit's set_config() assumes that if there is no more | ||
400 | * then MAX_CONFIG_INTERFACES interfaces in a configuration | ||
401 | * then there is a NULL pointer after the last interface in | ||
402 | * c->interface array. We need to make sure this is true. */ | ||
403 | if (c->next_interface_id < ARRAY_SIZE(c->interface)) | ||
404 | c->interface[c->next_interface_id] = NULL; | ||
405 | |||
395 | return 0; | 406 | return 0; |
396 | } | 407 | } |
397 | 408 | ||
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 43abf55d8c60..4c3ac5c42237 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c | |||
@@ -82,7 +82,7 @@ static struct class *usb_gadget_class; | |||
82 | struct printer_dev { | 82 | struct printer_dev { |
83 | spinlock_t lock; /* lock this structure */ | 83 | spinlock_t lock; /* lock this structure */ |
84 | /* lock buffer lists during read/write calls */ | 84 | /* lock buffer lists during read/write calls */ |
85 | spinlock_t lock_printer_io; | 85 | struct mutex lock_printer_io; |
86 | struct usb_gadget *gadget; | 86 | struct usb_gadget *gadget; |
87 | struct usb_request *req; /* for control responses */ | 87 | struct usb_request *req; /* for control responses */ |
88 | u8 config; | 88 | u8 config; |
@@ -567,7 +567,7 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) | |||
567 | 567 | ||
568 | DBG(dev, "printer_read trying to read %d bytes\n", (int)len); | 568 | DBG(dev, "printer_read trying to read %d bytes\n", (int)len); |
569 | 569 | ||
570 | spin_lock(&dev->lock_printer_io); | 570 | mutex_lock(&dev->lock_printer_io); |
571 | spin_lock_irqsave(&dev->lock, flags); | 571 | spin_lock_irqsave(&dev->lock, flags); |
572 | 572 | ||
573 | /* We will use this flag later to check if a printer reset happened | 573 | /* We will use this flag later to check if a printer reset happened |
@@ -601,7 +601,7 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) | |||
601 | * call or not. | 601 | * call or not. |
602 | */ | 602 | */ |
603 | if (fd->f_flags & (O_NONBLOCK|O_NDELAY)) { | 603 | if (fd->f_flags & (O_NONBLOCK|O_NDELAY)) { |
604 | spin_unlock(&dev->lock_printer_io); | 604 | mutex_unlock(&dev->lock_printer_io); |
605 | return -EAGAIN; | 605 | return -EAGAIN; |
606 | } | 606 | } |
607 | 607 | ||
@@ -648,7 +648,7 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) | |||
648 | if (dev->reset_printer) { | 648 | if (dev->reset_printer) { |
649 | list_add(¤t_rx_req->list, &dev->rx_reqs); | 649 | list_add(¤t_rx_req->list, &dev->rx_reqs); |
650 | spin_unlock_irqrestore(&dev->lock, flags); | 650 | spin_unlock_irqrestore(&dev->lock, flags); |
651 | spin_unlock(&dev->lock_printer_io); | 651 | mutex_unlock(&dev->lock_printer_io); |
652 | return -EAGAIN; | 652 | return -EAGAIN; |
653 | } | 653 | } |
654 | 654 | ||
@@ -673,7 +673,7 @@ printer_read(struct file *fd, char __user *buf, size_t len, loff_t *ptr) | |||
673 | dev->current_rx_buf = current_rx_buf; | 673 | dev->current_rx_buf = current_rx_buf; |
674 | 674 | ||
675 | spin_unlock_irqrestore(&dev->lock, flags); | 675 | spin_unlock_irqrestore(&dev->lock, flags); |
676 | spin_unlock(&dev->lock_printer_io); | 676 | mutex_unlock(&dev->lock_printer_io); |
677 | 677 | ||
678 | DBG(dev, "printer_read returned %d bytes\n", (int)bytes_copied); | 678 | DBG(dev, "printer_read returned %d bytes\n", (int)bytes_copied); |
679 | 679 | ||
@@ -697,7 +697,7 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
697 | if (len == 0) | 697 | if (len == 0) |
698 | return -EINVAL; | 698 | return -EINVAL; |
699 | 699 | ||
700 | spin_lock(&dev->lock_printer_io); | 700 | mutex_lock(&dev->lock_printer_io); |
701 | spin_lock_irqsave(&dev->lock, flags); | 701 | spin_lock_irqsave(&dev->lock, flags); |
702 | 702 | ||
703 | /* Check if a printer reset happens while we have interrupts on */ | 703 | /* Check if a printer reset happens while we have interrupts on */ |
@@ -713,7 +713,7 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
713 | * a NON-Blocking call or not. | 713 | * a NON-Blocking call or not. |
714 | */ | 714 | */ |
715 | if (fd->f_flags & (O_NONBLOCK|O_NDELAY)) { | 715 | if (fd->f_flags & (O_NONBLOCK|O_NDELAY)) { |
716 | spin_unlock(&dev->lock_printer_io); | 716 | mutex_unlock(&dev->lock_printer_io); |
717 | return -EAGAIN; | 717 | return -EAGAIN; |
718 | } | 718 | } |
719 | 719 | ||
@@ -752,7 +752,7 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
752 | 752 | ||
753 | if (copy_from_user(req->buf, buf, size)) { | 753 | if (copy_from_user(req->buf, buf, size)) { |
754 | list_add(&req->list, &dev->tx_reqs); | 754 | list_add(&req->list, &dev->tx_reqs); |
755 | spin_unlock(&dev->lock_printer_io); | 755 | mutex_unlock(&dev->lock_printer_io); |
756 | return bytes_copied; | 756 | return bytes_copied; |
757 | } | 757 | } |
758 | 758 | ||
@@ -766,14 +766,14 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
766 | if (dev->reset_printer) { | 766 | if (dev->reset_printer) { |
767 | list_add(&req->list, &dev->tx_reqs); | 767 | list_add(&req->list, &dev->tx_reqs); |
768 | spin_unlock_irqrestore(&dev->lock, flags); | 768 | spin_unlock_irqrestore(&dev->lock, flags); |
769 | spin_unlock(&dev->lock_printer_io); | 769 | mutex_unlock(&dev->lock_printer_io); |
770 | return -EAGAIN; | 770 | return -EAGAIN; |
771 | } | 771 | } |
772 | 772 | ||
773 | if (usb_ep_queue(dev->in_ep, req, GFP_ATOMIC)) { | 773 | if (usb_ep_queue(dev->in_ep, req, GFP_ATOMIC)) { |
774 | list_add(&req->list, &dev->tx_reqs); | 774 | list_add(&req->list, &dev->tx_reqs); |
775 | spin_unlock_irqrestore(&dev->lock, flags); | 775 | spin_unlock_irqrestore(&dev->lock, flags); |
776 | spin_unlock(&dev->lock_printer_io); | 776 | mutex_unlock(&dev->lock_printer_io); |
777 | return -EAGAIN; | 777 | return -EAGAIN; |
778 | } | 778 | } |
779 | 779 | ||
@@ -782,7 +782,7 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr) | |||
782 | } | 782 | } |
783 | 783 | ||
784 | spin_unlock_irqrestore(&dev->lock, flags); | 784 | spin_unlock_irqrestore(&dev->lock, flags); |
785 | spin_unlock(&dev->lock_printer_io); | 785 | mutex_unlock(&dev->lock_printer_io); |
786 | 786 | ||
787 | DBG(dev, "printer_write sent %d bytes\n", (int)bytes_copied); | 787 | DBG(dev, "printer_write sent %d bytes\n", (int)bytes_copied); |
788 | 788 | ||
@@ -820,11 +820,11 @@ printer_poll(struct file *fd, poll_table *wait) | |||
820 | unsigned long flags; | 820 | unsigned long flags; |
821 | int status = 0; | 821 | int status = 0; |
822 | 822 | ||
823 | spin_lock(&dev->lock_printer_io); | 823 | mutex_lock(&dev->lock_printer_io); |
824 | spin_lock_irqsave(&dev->lock, flags); | 824 | spin_lock_irqsave(&dev->lock, flags); |
825 | setup_rx_reqs(dev); | 825 | setup_rx_reqs(dev); |
826 | spin_unlock_irqrestore(&dev->lock, flags); | 826 | spin_unlock_irqrestore(&dev->lock, flags); |
827 | spin_unlock(&dev->lock_printer_io); | 827 | mutex_unlock(&dev->lock_printer_io); |
828 | 828 | ||
829 | poll_wait(fd, &dev->rx_wait, wait); | 829 | poll_wait(fd, &dev->rx_wait, wait); |
830 | poll_wait(fd, &dev->tx_wait, wait); | 830 | poll_wait(fd, &dev->tx_wait, wait); |
@@ -1461,7 +1461,7 @@ autoconf_fail: | |||
1461 | } | 1461 | } |
1462 | 1462 | ||
1463 | spin_lock_init(&dev->lock); | 1463 | spin_lock_init(&dev->lock); |
1464 | spin_lock_init(&dev->lock_printer_io); | 1464 | mutex_init(&dev->lock_printer_io); |
1465 | INIT_LIST_HEAD(&dev->tx_reqs); | 1465 | INIT_LIST_HEAD(&dev->tx_reqs); |
1466 | INIT_LIST_HEAD(&dev->tx_reqs_active); | 1466 | INIT_LIST_HEAD(&dev->tx_reqs_active); |
1467 | INIT_LIST_HEAD(&dev->rx_reqs); | 1467 | INIT_LIST_HEAD(&dev->rx_reqs); |
@@ -1594,7 +1594,7 @@ cleanup(void) | |||
1594 | { | 1594 | { |
1595 | int status; | 1595 | int status; |
1596 | 1596 | ||
1597 | spin_lock(&usb_printer_gadget.lock_printer_io); | 1597 | mutex_lock(&usb_printer_gadget.lock_printer_io); |
1598 | class_destroy(usb_gadget_class); | 1598 | class_destroy(usb_gadget_class); |
1599 | unregister_chrdev_region(g_printer_devno, 2); | 1599 | unregister_chrdev_region(g_printer_devno, 2); |
1600 | 1600 | ||
@@ -1602,6 +1602,6 @@ cleanup(void) | |||
1602 | if (status) | 1602 | if (status) |
1603 | ERROR(dev, "usb_gadget_unregister_driver %x\n", status); | 1603 | ERROR(dev, "usb_gadget_unregister_driver %x\n", status); |
1604 | 1604 | ||
1605 | spin_unlock(&usb_printer_gadget.lock_printer_io); | 1605 | mutex_unlock(&usb_printer_gadget.lock_printer_io); |
1606 | } | 1606 | } |
1607 | module_exit(cleanup); | 1607 | module_exit(cleanup); |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index d5f4c1d45c97..e724a051bfdd 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -1700,9 +1700,13 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
1700 | if (!driver || driver != udc->driver || !driver->unbind) | 1700 | if (!driver || driver != udc->driver || !driver->unbind) |
1701 | return -EINVAL; | 1701 | return -EINVAL; |
1702 | 1702 | ||
1703 | dprintk(DEBUG_NORMAL,"usb_gadget_register_driver() '%s'\n", | 1703 | dprintk(DEBUG_NORMAL, "usb_gadget_unregister_driver() '%s'\n", |
1704 | driver->driver.name); | 1704 | driver->driver.name); |
1705 | 1705 | ||
1706 | /* report disconnect */ | ||
1707 | if (driver->disconnect) | ||
1708 | driver->disconnect(&udc->gadget); | ||
1709 | |||
1706 | driver->unbind(&udc->gadget); | 1710 | driver->unbind(&udc->gadget); |
1707 | 1711 | ||
1708 | device_del(&udc->gadget.dev); | 1712 | device_del(&udc->gadget.dev); |
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index 16bdf77f582a..3e8dcb5455e3 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c | |||
@@ -536,17 +536,11 @@ recycle: | |||
536 | list_move(&req->list, &port->read_pool); | 536 | list_move(&req->list, &port->read_pool); |
537 | } | 537 | } |
538 | 538 | ||
539 | /* Push from tty to ldisc; this is immediate with low_latency, and | 539 | /* Push from tty to ldisc; without low_latency set this is handled by |
540 | * may trigger callbacks to this driver ... so drop the spinlock. | 540 | * a workqueue, so we won't get callbacks and can hold port_lock |
541 | */ | 541 | */ |
542 | if (tty && do_push) { | 542 | if (tty && do_push) { |
543 | spin_unlock_irq(&port->port_lock); | ||
544 | tty_flip_buffer_push(tty); | 543 | tty_flip_buffer_push(tty); |
545 | wake_up_interruptible(&tty->read_wait); | ||
546 | spin_lock_irq(&port->port_lock); | ||
547 | |||
548 | /* tty may have been closed */ | ||
549 | tty = port->port_tty; | ||
550 | } | 544 | } |
551 | 545 | ||
552 | 546 | ||
@@ -784,11 +778,6 @@ static int gs_open(struct tty_struct *tty, struct file *file) | |||
784 | port->open_count = 1; | 778 | port->open_count = 1; |
785 | port->openclose = false; | 779 | port->openclose = false; |
786 | 780 | ||
787 | /* low_latency means ldiscs work in tasklet context, without | ||
788 | * needing a workqueue schedule ... easier to keep up. | ||
789 | */ | ||
790 | tty->low_latency = 1; | ||
791 | |||
792 | /* if connected, start the I/O stream */ | 781 | /* if connected, start the I/O stream */ |
793 | if (port->port_usb) { | 782 | if (port->port_usb) { |
794 | struct gserial *gser = port->port_usb; | 783 | struct gserial *gser = port->port_usb; |
@@ -1195,6 +1184,7 @@ void gserial_cleanup(void) | |||
1195 | n_ports = 0; | 1184 | n_ports = 0; |
1196 | 1185 | ||
1197 | tty_unregister_driver(gs_tty_driver); | 1186 | tty_unregister_driver(gs_tty_driver); |
1187 | put_tty_driver(gs_tty_driver); | ||
1198 | gs_tty_driver = NULL; | 1188 | gs_tty_driver = NULL; |
1199 | 1189 | ||
1200 | pr_debug("%s: cleaned up ttyGS* support\n", __func__); | 1190 | pr_debug("%s: cleaned up ttyGS* support\n", __func__); |
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index 544ccfd7056e..bd4027745aa7 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -207,10 +207,17 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
207 | /* Initialize the transceiver */ | 207 | /* Initialize the transceiver */ |
208 | if (pdata->otg) { | 208 | if (pdata->otg) { |
209 | pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET; | 209 | pdata->otg->io_priv = hcd->regs + ULPI_VIEWPORT_OFFSET; |
210 | if (otg_init(pdata->otg) != 0) | 210 | ret = otg_init(pdata->otg); |
211 | dev_err(dev, "unable to init transceiver\n"); | 211 | if (ret) { |
212 | else if (otg_set_vbus(pdata->otg, 1) != 0) | 212 | dev_err(dev, "unable to init transceiver, probably missing\n"); |
213 | ret = -ENODEV; | ||
214 | goto err_add; | ||
215 | } | ||
216 | ret = otg_set_vbus(pdata->otg, 1); | ||
217 | if (ret) { | ||
213 | dev_err(dev, "unable to enable vbus on transceiver\n"); | 218 | dev_err(dev, "unable to enable vbus on transceiver\n"); |
219 | goto err_add; | ||
220 | } | ||
214 | } | 221 | } |
215 | 222 | ||
216 | priv->hcd = hcd; | 223 | priv->hcd = hcd; |
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c index 20a0dfe0fe36..0587ad4ce5c2 100644 --- a/drivers/usb/host/isp1362-hcd.c +++ b/drivers/usb/host/isp1362-hcd.c | |||
@@ -2224,12 +2224,9 @@ static void remove_debug_file(struct isp1362_hcd *isp1362_hcd) | |||
2224 | 2224 | ||
2225 | /*-------------------------------------------------------------------------*/ | 2225 | /*-------------------------------------------------------------------------*/ |
2226 | 2226 | ||
2227 | static void isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd) | 2227 | static void __isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd) |
2228 | { | 2228 | { |
2229 | int tmp = 20; | 2229 | int tmp = 20; |
2230 | unsigned long flags; | ||
2231 | |||
2232 | spin_lock_irqsave(&isp1362_hcd->lock, flags); | ||
2233 | 2230 | ||
2234 | isp1362_write_reg16(isp1362_hcd, HCSWRES, HCSWRES_MAGIC); | 2231 | isp1362_write_reg16(isp1362_hcd, HCSWRES, HCSWRES_MAGIC); |
2235 | isp1362_write_reg32(isp1362_hcd, HCCMDSTAT, OHCI_HCR); | 2232 | isp1362_write_reg32(isp1362_hcd, HCCMDSTAT, OHCI_HCR); |
@@ -2240,6 +2237,14 @@ static void isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd) | |||
2240 | } | 2237 | } |
2241 | if (!tmp) | 2238 | if (!tmp) |
2242 | pr_err("Software reset timeout\n"); | 2239 | pr_err("Software reset timeout\n"); |
2240 | } | ||
2241 | |||
2242 | static void isp1362_sw_reset(struct isp1362_hcd *isp1362_hcd) | ||
2243 | { | ||
2244 | unsigned long flags; | ||
2245 | |||
2246 | spin_lock_irqsave(&isp1362_hcd->lock, flags); | ||
2247 | __isp1362_sw_reset(isp1362_hcd); | ||
2243 | spin_unlock_irqrestore(&isp1362_hcd->lock, flags); | 2248 | spin_unlock_irqrestore(&isp1362_hcd->lock, flags); |
2244 | } | 2249 | } |
2245 | 2250 | ||
@@ -2418,7 +2423,7 @@ static void isp1362_hc_stop(struct usb_hcd *hcd) | |||
2418 | if (isp1362_hcd->board && isp1362_hcd->board->reset) | 2423 | if (isp1362_hcd->board && isp1362_hcd->board->reset) |
2419 | isp1362_hcd->board->reset(hcd->self.controller, 1); | 2424 | isp1362_hcd->board->reset(hcd->self.controller, 1); |
2420 | else | 2425 | else |
2421 | isp1362_sw_reset(isp1362_hcd); | 2426 | __isp1362_sw_reset(isp1362_hcd); |
2422 | 2427 | ||
2423 | if (isp1362_hcd->board && isp1362_hcd->board->clock) | 2428 | if (isp1362_hcd->board && isp1362_hcd->board->clock) |
2424 | isp1362_hcd->board->clock(hcd->self.controller, 0); | 2429 | isp1362_hcd->board->clock(hcd->self.controller, 0); |
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index 1a2bb4ce638f..77be3c24a427 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -1065,7 +1065,7 @@ static void r8a66597_usb_connect(struct r8a66597 *r8a66597, int port) | |||
1065 | else if (speed == LSMODE) | 1065 | else if (speed == LSMODE) |
1066 | rh->port |= USB_PORT_STAT_LOW_SPEED; | 1066 | rh->port |= USB_PORT_STAT_LOW_SPEED; |
1067 | 1067 | ||
1068 | rh->port &= USB_PORT_STAT_RESET; | 1068 | rh->port &= ~USB_PORT_STAT_RESET; |
1069 | rh->port |= USB_PORT_STAT_ENABLE; | 1069 | rh->port |= USB_PORT_STAT_ENABLE; |
1070 | } | 1070 | } |
1071 | 1071 | ||
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 9012098add6b..94e6934edb09 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -182,8 +182,12 @@ static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer | |||
182 | * set, but other sections talk about dealing with the chain bit set. This was | 182 | * set, but other sections talk about dealing with the chain bit set. This was |
183 | * fixed in the 0.96 specification errata, but we have to assume that all 0.95 | 183 | * fixed in the 0.96 specification errata, but we have to assume that all 0.95 |
184 | * xHCI hardware can't handle the chain bit being cleared on a link TRB. | 184 | * xHCI hardware can't handle the chain bit being cleared on a link TRB. |
185 | * | ||
186 | * @more_trbs_coming: Will you enqueue more TRBs before calling | ||
187 | * prepare_transfer()? | ||
185 | */ | 188 | */ |
186 | static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer) | 189 | static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, |
190 | bool consumer, bool more_trbs_coming) | ||
187 | { | 191 | { |
188 | u32 chain; | 192 | u32 chain; |
189 | union xhci_trb *next; | 193 | union xhci_trb *next; |
@@ -199,15 +203,28 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer | |||
199 | while (last_trb(xhci, ring, ring->enq_seg, next)) { | 203 | while (last_trb(xhci, ring, ring->enq_seg, next)) { |
200 | if (!consumer) { | 204 | if (!consumer) { |
201 | if (ring != xhci->event_ring) { | 205 | if (ring != xhci->event_ring) { |
202 | if (chain) { | 206 | /* |
203 | next->link.control |= TRB_CHAIN; | 207 | * If the caller doesn't plan on enqueueing more |
204 | 208 | * TDs before ringing the doorbell, then we | |
205 | /* Give this link TRB to the hardware */ | 209 | * don't want to give the link TRB to the |
206 | wmb(); | 210 | * hardware just yet. We'll give the link TRB |
207 | next->link.control ^= TRB_CYCLE; | 211 | * back in prepare_ring() just before we enqueue |
208 | } else { | 212 | * the TD at the top of the ring. |
213 | */ | ||
214 | if (!chain && !more_trbs_coming) | ||
209 | break; | 215 | break; |
216 | |||
217 | /* If we're not dealing with 0.95 hardware, | ||
218 | * carry over the chain bit of the previous TRB | ||
219 | * (which may mean the chain bit is cleared). | ||
220 | */ | ||
221 | if (!xhci_link_trb_quirk(xhci)) { | ||
222 | next->link.control &= ~TRB_CHAIN; | ||
223 | next->link.control |= chain; | ||
210 | } | 224 | } |
225 | /* Give this link TRB to the hardware */ | ||
226 | wmb(); | ||
227 | next->link.control ^= TRB_CYCLE; | ||
211 | } | 228 | } |
212 | /* Toggle the cycle bit after the last ring segment. */ | 229 | /* Toggle the cycle bit after the last ring segment. */ |
213 | if (last_trb_on_last_seg(xhci, ring, ring->enq_seg, next)) { | 230 | if (last_trb_on_last_seg(xhci, ring, ring->enq_seg, next)) { |
@@ -1707,9 +1724,12 @@ void xhci_handle_event(struct xhci_hcd *xhci) | |||
1707 | /* | 1724 | /* |
1708 | * Generic function for queueing a TRB on a ring. | 1725 | * Generic function for queueing a TRB on a ring. |
1709 | * The caller must have checked to make sure there's room on the ring. | 1726 | * The caller must have checked to make sure there's room on the ring. |
1727 | * | ||
1728 | * @more_trbs_coming: Will you enqueue more TRBs before calling | ||
1729 | * prepare_transfer()? | ||
1710 | */ | 1730 | */ |
1711 | static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring, | 1731 | static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring, |
1712 | bool consumer, | 1732 | bool consumer, bool more_trbs_coming, |
1713 | u32 field1, u32 field2, u32 field3, u32 field4) | 1733 | u32 field1, u32 field2, u32 field3, u32 field4) |
1714 | { | 1734 | { |
1715 | struct xhci_generic_trb *trb; | 1735 | struct xhci_generic_trb *trb; |
@@ -1719,7 +1739,7 @@ static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring, | |||
1719 | trb->field[1] = field2; | 1739 | trb->field[1] = field2; |
1720 | trb->field[2] = field3; | 1740 | trb->field[2] = field3; |
1721 | trb->field[3] = field4; | 1741 | trb->field[3] = field4; |
1722 | inc_enq(xhci, ring, consumer); | 1742 | inc_enq(xhci, ring, consumer, more_trbs_coming); |
1723 | } | 1743 | } |
1724 | 1744 | ||
1725 | /* | 1745 | /* |
@@ -1988,6 +2008,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
1988 | int trb_buff_len, this_sg_len, running_total; | 2008 | int trb_buff_len, this_sg_len, running_total; |
1989 | bool first_trb; | 2009 | bool first_trb; |
1990 | u64 addr; | 2010 | u64 addr; |
2011 | bool more_trbs_coming; | ||
1991 | 2012 | ||
1992 | struct xhci_generic_trb *start_trb; | 2013 | struct xhci_generic_trb *start_trb; |
1993 | int start_cycle; | 2014 | int start_cycle; |
@@ -2073,7 +2094,11 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
2073 | length_field = TRB_LEN(trb_buff_len) | | 2094 | length_field = TRB_LEN(trb_buff_len) | |
2074 | remainder | | 2095 | remainder | |
2075 | TRB_INTR_TARGET(0); | 2096 | TRB_INTR_TARGET(0); |
2076 | queue_trb(xhci, ep_ring, false, | 2097 | if (num_trbs > 1) |
2098 | more_trbs_coming = true; | ||
2099 | else | ||
2100 | more_trbs_coming = false; | ||
2101 | queue_trb(xhci, ep_ring, false, more_trbs_coming, | ||
2077 | lower_32_bits(addr), | 2102 | lower_32_bits(addr), |
2078 | upper_32_bits(addr), | 2103 | upper_32_bits(addr), |
2079 | length_field, | 2104 | length_field, |
@@ -2124,6 +2149,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
2124 | int num_trbs; | 2149 | int num_trbs; |
2125 | struct xhci_generic_trb *start_trb; | 2150 | struct xhci_generic_trb *start_trb; |
2126 | bool first_trb; | 2151 | bool first_trb; |
2152 | bool more_trbs_coming; | ||
2127 | int start_cycle; | 2153 | int start_cycle; |
2128 | u32 field, length_field; | 2154 | u32 field, length_field; |
2129 | 2155 | ||
@@ -2212,7 +2238,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
2212 | length_field = TRB_LEN(trb_buff_len) | | 2238 | length_field = TRB_LEN(trb_buff_len) | |
2213 | remainder | | 2239 | remainder | |
2214 | TRB_INTR_TARGET(0); | 2240 | TRB_INTR_TARGET(0); |
2215 | queue_trb(xhci, ep_ring, false, | 2241 | if (num_trbs > 1) |
2242 | more_trbs_coming = true; | ||
2243 | else | ||
2244 | more_trbs_coming = false; | ||
2245 | queue_trb(xhci, ep_ring, false, more_trbs_coming, | ||
2216 | lower_32_bits(addr), | 2246 | lower_32_bits(addr), |
2217 | upper_32_bits(addr), | 2247 | upper_32_bits(addr), |
2218 | length_field, | 2248 | length_field, |
@@ -2291,7 +2321,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
2291 | /* Queue setup TRB - see section 6.4.1.2.1 */ | 2321 | /* Queue setup TRB - see section 6.4.1.2.1 */ |
2292 | /* FIXME better way to translate setup_packet into two u32 fields? */ | 2322 | /* FIXME better way to translate setup_packet into two u32 fields? */ |
2293 | setup = (struct usb_ctrlrequest *) urb->setup_packet; | 2323 | setup = (struct usb_ctrlrequest *) urb->setup_packet; |
2294 | queue_trb(xhci, ep_ring, false, | 2324 | queue_trb(xhci, ep_ring, false, true, |
2295 | /* FIXME endianness is probably going to bite my ass here. */ | 2325 | /* FIXME endianness is probably going to bite my ass here. */ |
2296 | setup->bRequestType | setup->bRequest << 8 | setup->wValue << 16, | 2326 | setup->bRequestType | setup->bRequest << 8 | setup->wValue << 16, |
2297 | setup->wIndex | setup->wLength << 16, | 2327 | setup->wIndex | setup->wLength << 16, |
@@ -2307,7 +2337,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
2307 | if (urb->transfer_buffer_length > 0) { | 2337 | if (urb->transfer_buffer_length > 0) { |
2308 | if (setup->bRequestType & USB_DIR_IN) | 2338 | if (setup->bRequestType & USB_DIR_IN) |
2309 | field |= TRB_DIR_IN; | 2339 | field |= TRB_DIR_IN; |
2310 | queue_trb(xhci, ep_ring, false, | 2340 | queue_trb(xhci, ep_ring, false, true, |
2311 | lower_32_bits(urb->transfer_dma), | 2341 | lower_32_bits(urb->transfer_dma), |
2312 | upper_32_bits(urb->transfer_dma), | 2342 | upper_32_bits(urb->transfer_dma), |
2313 | length_field, | 2343 | length_field, |
@@ -2324,7 +2354,7 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
2324 | field = 0; | 2354 | field = 0; |
2325 | else | 2355 | else |
2326 | field = TRB_DIR_IN; | 2356 | field = TRB_DIR_IN; |
2327 | queue_trb(xhci, ep_ring, false, | 2357 | queue_trb(xhci, ep_ring, false, false, |
2328 | 0, | 2358 | 0, |
2329 | 0, | 2359 | 0, |
2330 | TRB_INTR_TARGET(0), | 2360 | TRB_INTR_TARGET(0), |
@@ -2361,7 +2391,7 @@ static int queue_command(struct xhci_hcd *xhci, u32 field1, u32 field2, | |||
2361 | "unfailable commands failed.\n"); | 2391 | "unfailable commands failed.\n"); |
2362 | return -ENOMEM; | 2392 | return -ENOMEM; |
2363 | } | 2393 | } |
2364 | queue_trb(xhci, xhci->cmd_ring, false, field1, field2, field3, | 2394 | queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3, |
2365 | field4 | xhci->cmd_ring->cycle_state); | 2395 | field4 | xhci->cmd_ring->cycle_state); |
2366 | return 0; | 2396 | return 0; |
2367 | } | 2397 | } |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index fad70bc83555..3b795c56221f 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -219,8 +219,8 @@ static int musb_ulpi_write(struct otg_transceiver *otg, | |||
219 | return 0; | 219 | return 0; |
220 | } | 220 | } |
221 | #else | 221 | #else |
222 | #define musb_ulpi_read(a, b) NULL | 222 | #define musb_ulpi_read NULL |
223 | #define musb_ulpi_write(a, b, c) NULL | 223 | #define musb_ulpi_write NULL |
224 | #endif | 224 | #endif |
225 | 225 | ||
226 | static struct otg_io_access_ops musb_ulpi_access = { | 226 | static struct otg_io_access_ops musb_ulpi_access = { |
@@ -451,10 +451,6 @@ void musb_hnp_stop(struct musb *musb) | |||
451 | * @param power | 451 | * @param power |
452 | */ | 452 | */ |
453 | 453 | ||
454 | #define STAGE0_MASK (MUSB_INTR_RESUME | MUSB_INTR_SESSREQ \ | ||
455 | | MUSB_INTR_VBUSERROR | MUSB_INTR_CONNECT \ | ||
456 | | MUSB_INTR_RESET) | ||
457 | |||
458 | static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | 454 | static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, |
459 | u8 devctl, u8 power) | 455 | u8 devctl, u8 power) |
460 | { | 456 | { |
@@ -642,7 +638,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | |||
642 | handled = IRQ_HANDLED; | 638 | handled = IRQ_HANDLED; |
643 | } | 639 | } |
644 | 640 | ||
645 | 641 | #endif | |
646 | if (int_usb & MUSB_INTR_SUSPEND) { | 642 | if (int_usb & MUSB_INTR_SUSPEND) { |
647 | DBG(1, "SUSPEND (%s) devctl %02x power %02x\n", | 643 | DBG(1, "SUSPEND (%s) devctl %02x power %02x\n", |
648 | otg_state_string(musb), devctl, power); | 644 | otg_state_string(musb), devctl, power); |
@@ -705,6 +701,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | |||
705 | } | 701 | } |
706 | } | 702 | } |
707 | 703 | ||
704 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
708 | if (int_usb & MUSB_INTR_CONNECT) { | 705 | if (int_usb & MUSB_INTR_CONNECT) { |
709 | struct usb_hcd *hcd = musb_to_hcd(musb); | 706 | struct usb_hcd *hcd = musb_to_hcd(musb); |
710 | void __iomem *mbase = musb->mregs; | 707 | void __iomem *mbase = musb->mregs; |
@@ -1597,7 +1594,7 @@ irqreturn_t musb_interrupt(struct musb *musb) | |||
1597 | /* the core can interrupt us for multiple reasons; docs have | 1594 | /* the core can interrupt us for multiple reasons; docs have |
1598 | * a generic interrupt flowchart to follow | 1595 | * a generic interrupt flowchart to follow |
1599 | */ | 1596 | */ |
1600 | if (musb->int_usb & STAGE0_MASK) | 1597 | if (musb->int_usb) |
1601 | retval |= musb_stage0_irq(musb, musb->int_usb, | 1598 | retval |= musb_stage0_irq(musb, musb->int_usb, |
1602 | devctl, power); | 1599 | devctl, power); |
1603 | 1600 | ||
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index b22d02dea7d3..91d67794e350 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -470,7 +470,8 @@ struct musb_csr_regs { | |||
470 | 470 | ||
471 | struct musb_context_registers { | 471 | struct musb_context_registers { |
472 | 472 | ||
473 | #ifdef CONFIG_PM | 473 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ |
474 | defined(CONFIG_ARCH_OMAP4) | ||
474 | u32 otg_sysconfig, otg_forcestandby; | 475 | u32 otg_sysconfig, otg_forcestandby; |
475 | #endif | 476 | #endif |
476 | u8 power; | 477 | u8 power; |
@@ -484,7 +485,8 @@ struct musb_context_registers { | |||
484 | struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; | 485 | struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; |
485 | }; | 486 | }; |
486 | 487 | ||
487 | #ifdef CONFIG_PM | 488 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ |
489 | defined(CONFIG_ARCH_OMAP4) | ||
488 | extern void musb_platform_save_context(struct musb *musb, | 490 | extern void musb_platform_save_context(struct musb *musb, |
489 | struct musb_context_registers *musb_context); | 491 | struct musb_context_registers *musb_context); |
490 | extern void musb_platform_restore_context(struct musb *musb, | 492 | extern void musb_platform_restore_context(struct musb *musb, |
diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 1008044a3bbc..dc66e4376d49 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c | |||
@@ -132,18 +132,9 @@ static void configure_channel(struct dma_channel *channel, | |||
132 | if (mode) { | 132 | if (mode) { |
133 | csr |= 1 << MUSB_HSDMA_MODE1_SHIFT; | 133 | csr |= 1 << MUSB_HSDMA_MODE1_SHIFT; |
134 | BUG_ON(len < packet_sz); | 134 | BUG_ON(len < packet_sz); |
135 | |||
136 | if (packet_sz >= 64) { | ||
137 | csr |= MUSB_HSDMA_BURSTMODE_INCR16 | ||
138 | << MUSB_HSDMA_BURSTMODE_SHIFT; | ||
139 | } else if (packet_sz >= 32) { | ||
140 | csr |= MUSB_HSDMA_BURSTMODE_INCR8 | ||
141 | << MUSB_HSDMA_BURSTMODE_SHIFT; | ||
142 | } else if (packet_sz >= 16) { | ||
143 | csr |= MUSB_HSDMA_BURSTMODE_INCR4 | ||
144 | << MUSB_HSDMA_BURSTMODE_SHIFT; | ||
145 | } | ||
146 | } | 135 | } |
136 | csr |= MUSB_HSDMA_BURSTMODE_INCR16 | ||
137 | << MUSB_HSDMA_BURSTMODE_SHIFT; | ||
147 | 138 | ||
148 | csr |= (musb_channel->epnum << MUSB_HSDMA_ENDPOINT_SHIFT) | 139 | csr |= (musb_channel->epnum << MUSB_HSDMA_ENDPOINT_SHIFT) |
149 | | (1 << MUSB_HSDMA_ENABLE_SHIFT) | 140 | | (1 << MUSB_HSDMA_ENABLE_SHIFT) |
diff --git a/drivers/usb/otg/ulpi.c b/drivers/usb/otg/ulpi.c index b1b346932946..d331b222ad21 100644 --- a/drivers/usb/otg/ulpi.c +++ b/drivers/usb/otg/ulpi.c | |||
@@ -59,12 +59,17 @@ static int ulpi_set_flags(struct otg_transceiver *otg) | |||
59 | 59 | ||
60 | static int ulpi_init(struct otg_transceiver *otg) | 60 | static int ulpi_init(struct otg_transceiver *otg) |
61 | { | 61 | { |
62 | int i, vid, pid; | 62 | int i, vid, pid, ret; |
63 | 63 | u32 ulpi_id = 0; | |
64 | vid = (otg_io_read(otg, ULPI_VENDOR_ID_HIGH) << 8) | | 64 | |
65 | otg_io_read(otg, ULPI_VENDOR_ID_LOW); | 65 | for (i = 0; i < 4; i++) { |
66 | pid = (otg_io_read(otg, ULPI_PRODUCT_ID_HIGH) << 8) | | 66 | ret = otg_io_read(otg, ULPI_PRODUCT_ID_HIGH - i); |
67 | otg_io_read(otg, ULPI_PRODUCT_ID_LOW); | 67 | if (ret < 0) |
68 | return ret; | ||
69 | ulpi_id = (ulpi_id << 8) | ret; | ||
70 | } | ||
71 | vid = ulpi_id & 0xffff; | ||
72 | pid = ulpi_id >> 16; | ||
68 | 73 | ||
69 | pr_info("ULPI transceiver vendor/product ID 0x%04x/0x%04x\n", vid, pid); | 74 | pr_info("ULPI transceiver vendor/product ID 0x%04x/0x%04x\n", vid, pid); |
70 | 75 | ||
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 79dd1ae195e5..da7e334b0407 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -653,7 +653,6 @@ static struct usb_device_id id_table_combined [] = { | |||
653 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, | 653 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, |
654 | { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, | 654 | { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, |
655 | { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, | 655 | { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, |
656 | { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) }, | ||
657 | { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, | 656 | { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, |
658 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, | 657 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, |
659 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, | 658 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 94d86c3febcb..bbc159a1df45 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -501,13 +501,6 @@ | |||
501 | #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ | 501 | #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ |
502 | 502 | ||
503 | /* | 503 | /* |
504 | * Contec products (http://www.contec.com) | ||
505 | * Submitted by Daniel Sangorrin | ||
506 | */ | ||
507 | #define CONTEC_VID 0x06CE /* Vendor ID */ | ||
508 | #define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */ | ||
509 | |||
510 | /* | ||
511 | * Definitions for B&B Electronics products. | 504 | * Definitions for B&B Electronics products. |
512 | */ | 505 | */ |
513 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ | 506 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 04bb759536bb..93d72eb8cafc 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -139,6 +139,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
139 | "Could not set interface, error %d\n", | 139 | "Could not set interface, error %d\n", |
140 | retval); | 140 | retval); |
141 | retval = -ENODEV; | 141 | retval = -ENODEV; |
142 | kfree(data); | ||
142 | } | 143 | } |
143 | return retval; | 144 | return retval; |
144 | } | 145 | } |
@@ -155,6 +156,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
155 | "Could not set interface, error %d\n", | 156 | "Could not set interface, error %d\n", |
156 | retval); | 157 | retval); |
157 | retval = -ENODEV; | 158 | retval = -ENODEV; |
159 | kfree(data); | ||
158 | } | 160 | } |
159 | return retval; | 161 | return retval; |
160 | } | 162 | } |
@@ -163,6 +165,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) | |||
163 | default: | 165 | default: |
164 | dev_err(&serial->dev->dev, | 166 | dev_err(&serial->dev->dev, |
165 | "unknown number of interfaces: %d\n", nintf); | 167 | "unknown number of interfaces: %d\n", nintf); |
168 | kfree(data); | ||
166 | return -ENODEV; | 169 | return -ENODEV; |
167 | } | 170 | } |
168 | 171 | ||
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c index 76e7dac6f259..70b1d9d51c96 100644 --- a/drivers/video/geode/gxfb_core.c +++ b/drivers/video/geode/gxfb_core.c | |||
@@ -40,7 +40,7 @@ static int vram; | |||
40 | static int vt_switch; | 40 | static int vt_switch; |
41 | 41 | ||
42 | /* Modes relevant to the GX (taken from modedb.c) */ | 42 | /* Modes relevant to the GX (taken from modedb.c) */ |
43 | static struct fb_videomode gx_modedb[] __initdata = { | 43 | static struct fb_videomode gx_modedb[] __devinitdata = { |
44 | /* 640x480-60 VESA */ | 44 | /* 640x480-60 VESA */ |
45 | { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, | 45 | { NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2, |
46 | 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, | 46 | 0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA }, |
@@ -110,14 +110,15 @@ static struct fb_videomode gx_modedb[] __initdata = { | |||
110 | #ifdef CONFIG_OLPC | 110 | #ifdef CONFIG_OLPC |
111 | #include <asm/olpc.h> | 111 | #include <asm/olpc.h> |
112 | 112 | ||
113 | static struct fb_videomode gx_dcon_modedb[] __initdata = { | 113 | static struct fb_videomode gx_dcon_modedb[] __devinitdata = { |
114 | /* The only mode the DCON has is 1200x900 */ | 114 | /* The only mode the DCON has is 1200x900 */ |
115 | { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, | 115 | { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, |
116 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | 116 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
117 | FB_VMODE_NONINTERLACED, 0 } | 117 | FB_VMODE_NONINTERLACED, 0 } |
118 | }; | 118 | }; |
119 | 119 | ||
120 | static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | 120 | static void __devinit get_modedb(struct fb_videomode **modedb, |
121 | unsigned int *size) | ||
121 | { | 122 | { |
122 | if (olpc_has_dcon()) { | 123 | if (olpc_has_dcon()) { |
123 | *modedb = (struct fb_videomode *) gx_dcon_modedb; | 124 | *modedb = (struct fb_videomode *) gx_dcon_modedb; |
@@ -129,7 +130,8 @@ static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | |||
129 | } | 130 | } |
130 | 131 | ||
131 | #else | 132 | #else |
132 | static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | 133 | static void __devinit get_modedb(struct fb_videomode **modedb, |
134 | unsigned int *size) | ||
133 | { | 135 | { |
134 | *modedb = (struct fb_videomode *) gx_modedb; | 136 | *modedb = (struct fb_videomode *) gx_modedb; |
135 | *size = ARRAY_SIZE(gx_modedb); | 137 | *size = ARRAY_SIZE(gx_modedb); |
@@ -226,7 +228,8 @@ static int gxfb_blank(int blank_mode, struct fb_info *info) | |||
226 | return gx_blank_display(info, blank_mode); | 228 | return gx_blank_display(info, blank_mode); |
227 | } | 229 | } |
228 | 230 | ||
229 | static int __init gxfb_map_video_memory(struct fb_info *info, struct pci_dev *dev) | 231 | static int __devinit gxfb_map_video_memory(struct fb_info *info, |
232 | struct pci_dev *dev) | ||
230 | { | 233 | { |
231 | struct gxfb_par *par = info->par; | 234 | struct gxfb_par *par = info->par; |
232 | int ret; | 235 | int ret; |
@@ -290,7 +293,7 @@ static struct fb_ops gxfb_ops = { | |||
290 | .fb_imageblit = cfb_imageblit, | 293 | .fb_imageblit = cfb_imageblit, |
291 | }; | 294 | }; |
292 | 295 | ||
293 | static struct fb_info * __init gxfb_init_fbinfo(struct device *dev) | 296 | static struct fb_info *__devinit gxfb_init_fbinfo(struct device *dev) |
294 | { | 297 | { |
295 | struct gxfb_par *par; | 298 | struct gxfb_par *par; |
296 | struct fb_info *info; | 299 | struct fb_info *info; |
@@ -371,7 +374,8 @@ static int gxfb_resume(struct pci_dev *pdev) | |||
371 | } | 374 | } |
372 | #endif | 375 | #endif |
373 | 376 | ||
374 | static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 377 | static int __devinit gxfb_probe(struct pci_dev *pdev, |
378 | const struct pci_device_id *id) | ||
375 | { | 379 | { |
376 | struct gxfb_par *par; | 380 | struct gxfb_par *par; |
377 | struct fb_info *info; | 381 | struct fb_info *info; |
@@ -451,7 +455,7 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i | |||
451 | return ret; | 455 | return ret; |
452 | } | 456 | } |
453 | 457 | ||
454 | static void gxfb_remove(struct pci_dev *pdev) | 458 | static void __devexit gxfb_remove(struct pci_dev *pdev) |
455 | { | 459 | { |
456 | struct fb_info *info = pci_get_drvdata(pdev); | 460 | struct fb_info *info = pci_get_drvdata(pdev); |
457 | struct gxfb_par *par = info->par; | 461 | struct gxfb_par *par = info->par; |
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c index 1a18da86d3fa..39bdbedf43b4 100644 --- a/drivers/video/geode/lxfb_core.c +++ b/drivers/video/geode/lxfb_core.c | |||
@@ -35,7 +35,7 @@ static int vt_switch; | |||
35 | * we try to make it something sane - 640x480-60 is sane | 35 | * we try to make it something sane - 640x480-60 is sane |
36 | */ | 36 | */ |
37 | 37 | ||
38 | static struct fb_videomode geode_modedb[] __initdata = { | 38 | static struct fb_videomode geode_modedb[] __devinitdata = { |
39 | /* 640x480-60 */ | 39 | /* 640x480-60 */ |
40 | { NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2, | 40 | { NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2, |
41 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | 41 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
@@ -219,14 +219,15 @@ static struct fb_videomode geode_modedb[] __initdata = { | |||
219 | #ifdef CONFIG_OLPC | 219 | #ifdef CONFIG_OLPC |
220 | #include <asm/olpc.h> | 220 | #include <asm/olpc.h> |
221 | 221 | ||
222 | static struct fb_videomode olpc_dcon_modedb[] __initdata = { | 222 | static struct fb_videomode olpc_dcon_modedb[] __devinitdata = { |
223 | /* The only mode the DCON has is 1200x900 */ | 223 | /* The only mode the DCON has is 1200x900 */ |
224 | { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, | 224 | { NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3, |
225 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | 225 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
226 | FB_VMODE_NONINTERLACED, 0 } | 226 | FB_VMODE_NONINTERLACED, 0 } |
227 | }; | 227 | }; |
228 | 228 | ||
229 | static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | 229 | static void __devinit get_modedb(struct fb_videomode **modedb, |
230 | unsigned int *size) | ||
230 | { | 231 | { |
231 | if (olpc_has_dcon()) { | 232 | if (olpc_has_dcon()) { |
232 | *modedb = (struct fb_videomode *) olpc_dcon_modedb; | 233 | *modedb = (struct fb_videomode *) olpc_dcon_modedb; |
@@ -238,7 +239,8 @@ static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | |||
238 | } | 239 | } |
239 | 240 | ||
240 | #else | 241 | #else |
241 | static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size) | 242 | static void __devinit get_modedb(struct fb_videomode **modedb, |
243 | unsigned int *size) | ||
242 | { | 244 | { |
243 | *modedb = (struct fb_videomode *) geode_modedb; | 245 | *modedb = (struct fb_videomode *) geode_modedb; |
244 | *size = ARRAY_SIZE(geode_modedb); | 246 | *size = ARRAY_SIZE(geode_modedb); |
@@ -334,7 +336,7 @@ static int lxfb_blank(int blank_mode, struct fb_info *info) | |||
334 | } | 336 | } |
335 | 337 | ||
336 | 338 | ||
337 | static int __init lxfb_map_video_memory(struct fb_info *info, | 339 | static int __devinit lxfb_map_video_memory(struct fb_info *info, |
338 | struct pci_dev *dev) | 340 | struct pci_dev *dev) |
339 | { | 341 | { |
340 | struct lxfb_par *par = info->par; | 342 | struct lxfb_par *par = info->par; |
@@ -412,7 +414,7 @@ static struct fb_ops lxfb_ops = { | |||
412 | .fb_imageblit = cfb_imageblit, | 414 | .fb_imageblit = cfb_imageblit, |
413 | }; | 415 | }; |
414 | 416 | ||
415 | static struct fb_info * __init lxfb_init_fbinfo(struct device *dev) | 417 | static struct fb_info * __devinit lxfb_init_fbinfo(struct device *dev) |
416 | { | 418 | { |
417 | struct lxfb_par *par; | 419 | struct lxfb_par *par; |
418 | struct fb_info *info; | 420 | struct fb_info *info; |
@@ -496,7 +498,7 @@ static int lxfb_resume(struct pci_dev *pdev) | |||
496 | #define lxfb_resume NULL | 498 | #define lxfb_resume NULL |
497 | #endif | 499 | #endif |
498 | 500 | ||
499 | static int __init lxfb_probe(struct pci_dev *pdev, | 501 | static int __devinit lxfb_probe(struct pci_dev *pdev, |
500 | const struct pci_device_id *id) | 502 | const struct pci_device_id *id) |
501 | { | 503 | { |
502 | struct lxfb_par *par; | 504 | struct lxfb_par *par; |
@@ -588,7 +590,7 @@ err: | |||
588 | return ret; | 590 | return ret; |
589 | } | 591 | } |
590 | 592 | ||
591 | static void lxfb_remove(struct pci_dev *pdev) | 593 | static void __devexit lxfb_remove(struct pci_dev *pdev) |
592 | { | 594 | { |
593 | struct fb_info *info = pci_get_drvdata(pdev); | 595 | struct fb_info *info = pci_get_drvdata(pdev); |
594 | struct lxfb_par *par = info->par; | 596 | struct lxfb_par *par = info->par; |
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c index d4cde79ea15e..81687ed26ba9 100644 --- a/drivers/video/nuc900fb.c +++ b/drivers/video/nuc900fb.c | |||
@@ -596,8 +596,6 @@ static int __devinit nuc900fb_probe(struct platform_device *pdev) | |||
596 | goto release_regs; | 596 | goto release_regs; |
597 | } | 597 | } |
598 | 598 | ||
599 | nuc900_driver_clksrc_div(&pdev->dev, "ext", 0x2); | ||
600 | |||
601 | fbi->clk = clk_get(&pdev->dev, NULL); | 599 | fbi->clk = clk_get(&pdev->dev, NULL); |
602 | if (!fbi->clk || IS_ERR(fbi->clk)) { | 600 | if (!fbi->clk || IS_ERR(fbi->clk)) { |
603 | printk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n"); | 601 | printk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n"); |