Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
Staging: rtl8192u_usb: Add LG device ID 043e:7a01
Staging: rtl8192s_usb: Remove duplicate device ID
Staging: rt2870: add device id for Zyxel NWD-270N
Staging: comedi: fix read past end of array in cb_pcidda_attach()
Staging: rtl8192su: add device ids
Staging: rtl8192su: remove device ids
Staging: rtl8187se: Fix compile warnings in 2.6.35-rc2
Staging: wlags49_h2: Fix build error when CONFIG_SYSFS is not set
Staging: wlags49_h2: add missing <linux/string.h> for strlen
Staging: hv: fix hv_utils module to properly autoload
staging: hv: Fix race condition on vmbus channel initialization
Staging: comedi: drivers: adl_pci9111: Fix AI commands in TRIG_FOLLOW case
Staging: mrst-touchscreen: fix dereferencing free memory
Staging: batman-adv: fix function prototype
Staging: batman-adv: return -EFAULT on copy_to_user errors
staging: usbip: usbip_common: kill rx thread on tx thread creation error.

+145 -68
+12 -12
drivers/staging/batman-adv/bat_sysfs.c
··· 225 225 NULL, 226 226 }; 227 227 228 - static ssize_t transtable_local_read(struct kobject *kobj, 229 - struct bin_attribute *bin_attr, 230 - char *buff, loff_t off, size_t count) 228 + static ssize_t transtable_local_read(struct file *filp, struct kobject *kobj, 229 + struct bin_attribute *bin_attr, 230 + char *buff, loff_t off, size_t count) 231 231 { 232 232 struct device *dev = to_dev(kobj->parent); 233 233 struct net_device *net_dev = to_net_dev(dev); ··· 235 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, 239 - struct bin_attribute *bin_attr, 240 - char *buff, loff_t off, size_t count) 238 + static ssize_t transtable_global_read(struct file *filp, struct kobject *kobj, 239 + struct bin_attribute *bin_attr, 240 + char *buff, loff_t off, size_t count) 241 241 { 242 242 struct device *dev = to_dev(kobj->parent); 243 243 struct net_device *net_dev = to_net_dev(dev); ··· 245 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, 249 - struct bin_attribute *bin_attr, 250 - char *buff, loff_t off, size_t count) 248 + static ssize_t originators_read(struct file *filp, struct kobject *kobj, 249 + struct bin_attribute *bin_attr, 250 + char *buff, loff_t off, size_t count) 251 251 { 252 252 struct device *dev = to_dev(kobj->parent); 253 253 struct net_device *net_dev = to_net_dev(dev); ··· 255 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, 259 - struct bin_attribute *bin_attr, 260 - char *buff, loff_t off, size_t count) 258 + static ssize_t vis_data_read(struct file *filp, struct kobject *kobj, 259 + struct bin_attribute *bin_attr, 260 + char *buff, loff_t off, size_t count) 261 261 { 262 262 struct device *dev = to_dev(kobj->parent); 263 263 struct net_device *net_dev = to_net_dev(dev);
+1 -1
drivers/staging/batman-adv/device.c
··· 196 196 kfree(device_packet); 197 197 198 198 if (error) 199 - return error; 199 + return -EFAULT; 200 200 201 201 return sizeof(struct icmp_packet); 202 202 }
+6 -3
drivers/staging/comedi/drivers/adl_pci9111.c
··· 824 824 plx9050_interrupt_control(dev_private->lcr_io_base, true, true, 825 825 false, true, true); 826 826 827 - dev_private->scan_delay = 828 - (async_cmd->scan_begin_arg / (async_cmd->convert_arg * 829 - async_cmd->chanlist_len)) - 1; 827 + if (async_cmd->scan_begin_src == TRIG_TIMER) { 828 + dev_private->scan_delay = 829 + (async_cmd->scan_begin_arg / 830 + (async_cmd->convert_arg * 831 + async_cmd->chanlist_len)) - 1; 832 + } 830 833 831 834 break; 832 835
+1 -2
drivers/staging/comedi/drivers/cb_pcidda.c
··· 52 52 #include "8255.h" 53 53 54 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 55 #define EEPROM_SIZE 128 /* number of entries in eeprom */ 57 56 #define MAX_AO_CHANNELS 8 /* maximum number of ao channels for supported boards */ 58 57 ··· 306 307 continue; 307 308 } 308 309 } 309 - for (index = 0; index < N_BOARDS; index++) { 310 + for (index = 0; index < ARRAY_SIZE(cb_pcidda_boards); index++) { 310 311 if (cb_pcidda_boards[index].device_id == 311 312 pcidev->device) { 312 313 goto found;
+30 -11
drivers/staging/hv/channel_mgmt.c
··· 23 23 #include <linux/slab.h> 24 24 #include <linux/list.h> 25 25 #include <linux/module.h> 26 + #include <linux/completion.h> 26 27 #include "osd.h" 27 28 #include "logging.h" 28 29 #include "vmbus_private.h" ··· 294 293 Channel); 295 294 } 296 295 296 + 297 + DECLARE_COMPLETION(hv_channel_ready); 298 + 299 + /* 300 + * Count initialized channels, and ensure all channels are ready when hv_vmbus 301 + * module loading completes. 302 + */ 303 + static void count_hv_channel(void) 304 + { 305 + static int counter; 306 + unsigned long flags; 307 + 308 + spin_lock_irqsave(&gVmbusConnection.channel_lock, flags); 309 + if (++counter == MAX_MSG_TYPES) 310 + complete(&hv_channel_ready); 311 + spin_unlock_irqrestore(&gVmbusConnection.channel_lock, flags); 312 + } 313 + 314 + 297 315 /* 298 316 * VmbusChannelProcessOffer - Process the offer by creating a channel/device 299 317 * associated with this offer ··· 393 373 * can cleanup properly 394 374 */ 395 375 newChannel->State = CHANNEL_OPEN_STATE; 396 - cnt = 0; 397 376 398 - while (cnt != MAX_MSG_TYPES) { 377 + /* Open IC channels */ 378 + for (cnt = 0; cnt < MAX_MSG_TYPES; cnt++) { 399 379 if (memcmp(&newChannel->OfferMsg.Offer.InterfaceType, 400 380 &hv_cb_utils[cnt].data, 401 - sizeof(struct hv_guid)) == 0) { 381 + sizeof(struct hv_guid)) == 0 && 382 + VmbusChannelOpen(newChannel, 2 * PAGE_SIZE, 383 + 2 * PAGE_SIZE, NULL, 0, 384 + hv_cb_utils[cnt].callback, 385 + newChannel) == 0) { 386 + hv_cb_utils[cnt].channel = newChannel; 402 387 DPRINT_INFO(VMBUS, "%s", 403 - hv_cb_utils[cnt].log_msg); 404 - 405 - if (VmbusChannelOpen(newChannel, 2 * PAGE_SIZE, 406 - 2 * PAGE_SIZE, NULL, 0, 407 - hv_cb_utils[cnt].callback, 408 - newChannel) == 0) 409 - hv_cb_utils[cnt].channel = newChannel; 388 + hv_cb_utils[cnt].log_msg); 389 + count_hv_channel(); 410 390 } 411 - cnt++; 412 391 } 413 392 } 414 393 DPRINT_EXIT(VMBUS);
+28
drivers/staging/hv/hv_utils.c
··· 24 24 #include <linux/slab.h> 25 25 #include <linux/sysctl.h> 26 26 #include <linux/reboot.h> 27 + #include <linux/dmi.h> 28 + #include <linux/pci.h> 27 29 28 30 #include "logging.h" 29 31 #include "osd.h" ··· 253 251 DPRINT_EXIT(VMBUS); 254 252 } 255 253 254 + static const struct pci_device_id __initconst 255 + hv_utils_pci_table[] __maybe_unused = { 256 + { PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */ 257 + { 0 } 258 + }; 259 + MODULE_DEVICE_TABLE(pci, hv_utils_pci_table); 260 + 261 + 262 + static const struct dmi_system_id __initconst 263 + hv_utils_dmi_table[] __maybe_unused = { 264 + { 265 + .ident = "Hyper-V", 266 + .matches = { 267 + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), 268 + DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"), 269 + DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"), 270 + }, 271 + }, 272 + { }, 273 + }; 274 + MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table); 275 + 276 + 256 277 static int __init init_hyperv_utils(void) 257 278 { 258 279 printk(KERN_INFO "Registering HyperV Utility Driver\n"); 280 + 281 + if (!dmi_check_system(hv_utils_dmi_table)) 282 + return -ENODEV; 259 283 260 284 hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback = 261 285 &shutdown_onchannelcallback;
+2
drivers/staging/hv/vmbus.h
··· 74 74 void vmbus_child_driver_unregister(struct driver_context *driver_ctx); 75 75 void vmbus_get_interface(struct vmbus_channel_interface *interface); 76 76 77 + extern struct completion hv_channel_ready; 78 + 77 79 #endif /* _VMBUS_H_ */
+3
drivers/staging/hv/vmbus_drv.c
··· 27 27 #include <linux/pci.h> 28 28 #include <linux/dmi.h> 29 29 #include <linux/slab.h> 30 + #include <linux/completion.h> 30 31 #include "version_info.h" 31 32 #include "osd.h" 32 33 #include "logging.h" ··· 356 355 357 356 358 357 vmbus_drv_obj->GetChannelOffers(); 358 + 359 + wait_for_completion(&hv_channel_ready); 359 360 360 361 cleanup: 361 362 DPRINT_EXIT(VMBUS_DRV);
+1 -1
drivers/staging/mrst-touchscreen/intel-mid-touch.c
··· 817 817 free_irq(mrstouchdevp->irq, mrstouchdevp); 818 818 input_unregister_device(mrstouchdevp->input); 819 819 input_free_device(mrstouchdevp->input); 820 - kfree(mrstouchdevp); 821 820 if (mrstouchdevp->pendet_thrd) 822 821 kthread_stop(mrstouchdevp->pendet_thrd); 822 + kfree(mrstouchdevp); 823 823 return 0; 824 824 } 825 825
+1
drivers/staging/rt2860/usb_main_dev.c
··· 77 77 {USB_DEVICE(0x083A, 0x7522)}, /* Arcadyan */ 78 78 {USB_DEVICE(0x0CDE, 0x0022)}, /* ZCOM */ 79 79 {USB_DEVICE(0x0586, 0x3416)}, /* Zyxel */ 80 + {USB_DEVICE(0x0586, 0x341a)}, /* Zyxel NWD-270N */ 80 81 {USB_DEVICE(0x0CDE, 0x0025)}, /* Zyxel */ 81 82 {USB_DEVICE(0x1740, 0x9701)}, /* EnGenius */ 82 83 {USB_DEVICE(0x1740, 0x9702)}, /* EnGenius */
-2
drivers/staging/rtl8187se/r8180_core.c
··· 66 66 static int hwwep = 0; 67 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 69 MODULE_LICENSE("GPL"); 72 70 MODULE_DEVICE_TABLE(pci, rtl8180_pci_id_tbl); 73 71 MODULE_AUTHOR("Andrea Merello <andreamrl@tiscali.it>");
+22 -21
drivers/staging/rtl8192su/r8192U_core.c
··· 112 112 #define CAM_CONTENT_COUNT 8 113 113 114 114 static const struct usb_device_id rtl8192_usb_id_tbl[] = { 115 - /* 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 115 + {USB_DEVICE(0x0bda, 0x8171)}, /* Realtek */ 136 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
+2
drivers/staging/rtl8192u/r8192U_core.c
··· 121 121 {USB_DEVICE(0x2001, 0x3301)}, 122 122 /* Zinwell */ 123 123 {USB_DEVICE(0x5a57, 0x0290)}, 124 + /* LG */ 125 + {USB_DEVICE(0x043e, 0x7a01)}, 124 126 {} 125 127 }; 126 128
+33 -13
drivers/staging/usbip/usbip_common.c
··· 378 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 399 int usbip_start_threads(struct usbip_device *ud) 382 400 { 383 401 /* 384 402 * threads are invoked per one device (per one connection). 385 403 */ 386 404 struct task_struct *th; 405 + int err = 0; 387 406 388 407 th = kthread_run(usbip_thread, (void *)&ud->tcp_rx, "usbip"); 389 408 if (IS_ERR(th)) { 390 409 printk(KERN_WARNING 391 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 415 th = kthread_run(usbip_thread, (void *)&ud->tcp_tx, "usbip"); 395 416 if (IS_ERR(th)) { 396 417 printk(KERN_WARNING 397 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 423 /* confirm threads are starting */ 402 424 wait_for_completion(&ud->tcp_rx.thread_done); 403 425 wait_for_completion(&ud->tcp_tx.thread_done); 426 + 404 427 return 0; 428 + 429 + tx_thread_err: 430 + stop_rx_thread(ud); 431 + 432 + ust_exit: 433 + return err; 405 434 } 406 435 EXPORT_SYMBOL_GPL(usbip_start_threads); 407 436 408 437 void usbip_stop_threads(struct usbip_device *ud) 409 438 { 410 439 /* kill threads related to this sdev, if v.c. exists */ 411 - if (ud->tcp_rx.thread != NULL) { 412 - send_sig(SIGKILL, ud->tcp_rx.thread, 1); 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 - } 440 + stop_rx_thread(ud); 441 + stop_tx_thread(ud); 422 442 } 423 443 EXPORT_SYMBOL_GPL(usbip_stop_threads); 424 444
+1
drivers/staging/wlags49_h2/wl_enc.c
··· 62 62 /******************************************************************************* 63 63 * include files 64 64 ******************************************************************************/ 65 + #include <linux/string.h> 65 66 #include <wl_version.h> 66 67 67 68 #include <debug.h>
+2 -2
drivers/staging/wlags49_h2/wl_sysfs.h
··· 2 2 extern void register_wlags_sysfs(struct net_device *); 3 3 extern void unregister_wlags_sysfs(struct net_device *); 4 4 #else 5 - static void register_wlags_sysfs(struct net_device *) { return; }; 6 - static void unregister_wlags_sysfs(struct net_device *) { return; }; 5 + static inline void register_wlags_sysfs(struct net_device *net) { } 6 + static inline void unregister_wlags_sysfs(struct net_device *net) { } 7 7 #endif