Merge branch 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6

* 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (26 commits)
staging: r8712u: Add new device IDs
staging: brcm80211: fix suspend/resume issue in brcmsmac
staging: brcm80211: remove assert to avoid panic since 2.6.37 kernel
Staging: iio: Aditional fixpoint formatted output bugfix
staging: usbip: vhci: use urb->dev->portnum to find port
staging: usbip: vhci: handle EAGAIN from SO_RCVTIMEO
staging: usbip: vhci: friendly log messages for connection errors
staging: usbip: vhci: refuse to enqueue for dead connections
staging: usbip: vhci: give back URBs from in-flight unlink requests
staging: usbip: vhci: update reference count for usb_device
staging: usbip: stub: update refcounts for devices and interfaces
staging: tidspbridge: replace mbox callback with notifier_call
staging: comedi: ni_labpc: Use shared IRQ for PCMCIA card
Staging: speakup: &&/|| confusion in silent_store()
iio: Fixpoint formatted output bugfix
staging: rt2860: Fix incorrect netif_stop_queue usage warning
staging: r8712u: Fix memory leak in firmware loading
staging: tidspbridge: configure full L1 MMU range
staging: rt2870sta: Add ID for Linksys WUSB100v2
Staging: xgfib: put parenthesis in the right place
...

+295 -135
+2 -2
drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c
··· 360 360 status = 1; 361 361 goto complete; 362 362 } 363 - len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LENGTH: firmware->size; 364 - memcpy(config_bdaddr, firmware->data,len); 363 + len = min(firmware->size, MAX_BDADDR_FORMAT_LENGTH - 1); 364 + memcpy(config_bdaddr, firmware->data, len); 365 365 config_bdaddr[len] = '\0'; 366 366 write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); 367 367 A_RELEASE_FIRMWARE(firmware);
+23 -22
drivers/staging/brcm80211/sys/wl_mac80211.c
··· 209 209 struct wl_info *wl = hw->priv; 210 210 ASSERT(wl); 211 211 WL_LOCK(wl); 212 - wl_down(wl); 213 212 ieee80211_stop_queues(hw); 214 213 WL_UNLOCK(wl); 215 - 216 - return; 217 214 } 218 215 219 216 static int ··· 243 246 static void 244 247 wl_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) 245 248 { 246 - return; 249 + struct wl_info *wl; 250 + 251 + wl = HW_TO_WL(hw); 252 + 253 + /* put driver in down state */ 254 + WL_LOCK(wl); 255 + wl_down(wl); 256 + WL_UNLOCK(wl); 247 257 } 248 258 249 259 static int ··· 783 779 wl_found++; 784 780 return wl; 785 781 786 - fail: 782 + fail: 787 783 wl_free(wl); 788 784 fail1: 789 785 return NULL; ··· 1094 1090 return 0; 1095 1091 } 1096 1092 1097 - #ifdef LINUXSTA_PS 1098 1093 static int wl_suspend(struct pci_dev *pdev, pm_message_t state) 1099 1094 { 1100 1095 struct wl_info *wl; ··· 1108 1105 return -ENODEV; 1109 1106 } 1110 1107 1108 + /* only need to flag hw is down for proper resume */ 1111 1109 WL_LOCK(wl); 1112 - wl_down(wl); 1113 1110 wl->pub->hw_up = false; 1114 1111 WL_UNLOCK(wl); 1115 - pci_save_state(pdev, wl->pci_psstate); 1112 + 1113 + pci_save_state(pdev); 1116 1114 pci_disable_device(pdev); 1117 1115 return pci_set_power_state(pdev, PCI_D3hot); 1118 1116 } ··· 1137 1133 if (err) 1138 1134 return err; 1139 1135 1140 - pci_restore_state(pdev, wl->pci_psstate); 1136 + pci_restore_state(pdev); 1141 1137 1142 1138 err = pci_enable_device(pdev); 1143 1139 if (err) ··· 1149 1145 if ((val & 0x0000ff00) != 0) 1150 1146 pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); 1151 1147 1152 - WL_LOCK(wl); 1153 - err = wl_up(wl); 1154 - WL_UNLOCK(wl); 1155 - 1148 + /* 1149 + * done. driver will be put in up state 1150 + * in wl_ops_add_interface() call. 1151 + */ 1156 1152 return err; 1157 1153 } 1158 - #endif /* LINUXSTA_PS */ 1159 1154 1160 1155 static void wl_remove(struct pci_dev *pdev) 1161 1156 { ··· 1187 1184 } 1188 1185 1189 1186 static struct pci_driver wl_pci_driver = { 1190 - .name = "brcm80211", 1191 - .probe = wl_pci_probe, 1192 - #ifdef LINUXSTA_PS 1193 - .suspend = wl_suspend, 1194 - .resume = wl_resume, 1195 - #endif /* LINUXSTA_PS */ 1196 - .remove = __devexit_p(wl_remove), 1197 - .id_table = wl_id_table, 1187 + .name = "brcm80211", 1188 + .probe = wl_pci_probe, 1189 + .suspend = wl_suspend, 1190 + .resume = wl_resume, 1191 + .remove = __devexit_p(wl_remove), 1192 + .id_table = wl_id_table, 1198 1193 }; 1199 1194 1200 1195 /**
-1
drivers/staging/brcm80211/sys/wlc_mac80211.c
··· 5126 5126 fifo = prio2fifo[prio]; 5127 5127 5128 5128 ASSERT((uint) skb_headroom(sdu) >= TXOFF); 5129 - ASSERT(!(sdu->cloned)); 5130 5129 ASSERT(!(sdu->next)); 5131 5130 ASSERT(!(sdu->prev)); 5132 5131 ASSERT(fifo < NFIFO);
+2 -1
drivers/staging/comedi/drivers/ni_labpc.c
··· 575 575 /* grab our IRQ */ 576 576 if (irq) { 577 577 isr_flags = 0; 578 - if (thisboard->bustype == pci_bustype) 578 + if (thisboard->bustype == pci_bustype 579 + || thisboard->bustype == pcmcia_bustype) 579 580 isr_flags |= IRQF_SHARED; 580 581 if (request_irq(irq, labpc_interrupt, isr_flags, 581 582 driver_labpc.driver_name, dev)) {
+1
drivers/staging/hv/blkvsc_drv.c
··· 368 368 blkdev->gd->first_minor = 0; 369 369 blkdev->gd->fops = &block_ops; 370 370 blkdev->gd->private_data = blkdev; 371 + blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device); 371 372 sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum); 372 373 373 374 blkvsc_do_inquiry(blkdev);
+1 -1
drivers/staging/hv/netvsc.c
··· 1279 1279 /* ASSERT(device); */ 1280 1280 1281 1281 packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char), 1282 - GFP_KERNEL); 1282 + GFP_ATOMIC); 1283 1283 if (!packet) 1284 1284 return; 1285 1285 buffer = packet;
-1
drivers/staging/hv/netvsc_drv.c
··· 358 358 359 359 /* Set initial state */ 360 360 netif_carrier_off(net); 361 - netif_stop_queue(net); 362 361 363 362 net_device_ctx = netdev_priv(net); 364 363 net_device_ctx->device_ctx = device_ctx;
+1 -1
drivers/staging/iio/adc/ad7476_core.c
··· 68 68 /* Corresponds to Vref / 2^(bits) */ 69 69 unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; 70 70 71 - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); 71 + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); 72 72 } 73 73 static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7476_show_scale, NULL, 0); 74 74
+1 -1
drivers/staging/iio/adc/ad7887_core.c
··· 68 68 /* Corresponds to Vref / 2^(bits) */ 69 69 unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; 70 70 71 - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); 71 + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); 72 72 } 73 73 static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad7887_show_scale, NULL, 0); 74 74
+1 -1
drivers/staging/iio/adc/ad799x_core.c
··· 432 432 /* Corresponds to Vref / 2^(bits) */ 433 433 unsigned int scale_uv = (st->int_vref_mv * 1000) >> st->chip_info->bits; 434 434 435 - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); 435 + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); 436 436 } 437 437 438 438 static IIO_DEVICE_ATTR(in_scale, S_IRUGO, ad799x_show_scale, NULL, 0);
+1 -1
drivers/staging/iio/dac/ad5446.c
··· 87 87 /* Corresponds to Vref / 2^(bits) */ 88 88 unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; 89 89 90 - return sprintf(buf, "%d.%d\n", scale_uv / 1000, scale_uv % 1000); 90 + return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000); 91 91 } 92 92 static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0); 93 93
-2
drivers/staging/rt2860/rt_main_dev.c
··· 484 484 net_dev->ml_priv = (void *)pAd; 485 485 pAd->net_dev = net_dev; 486 486 487 - netif_stop_queue(net_dev); 488 - 489 487 return net_dev; 490 488 491 489 }
+1
drivers/staging/rt2860/usb_main_dev.c
··· 106 106 {USB_DEVICE(0x0411, 0x016f)}, /* MelCo.,Inc. WLI-UC-G301N */ 107 107 {USB_DEVICE(0x1737, 0x0070)}, /* Linksys WUSB100 */ 108 108 {USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */ 109 + {USB_DEVICE(0x1737, 0x0078)}, /* Linksys WUSB100v2 */ 109 110 {USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */ 110 111 {USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */ 111 112 {USB_DEVICE(0x100D, 0x9031)}, /* Motorola 2770 */
+7 -4
drivers/staging/rtl8712/hal_init.c
··· 128 128 u8 *ptmpchar = NULL, *ppayload, *ptr; 129 129 struct tx_desc *ptx_desc; 130 130 u32 txdscp_sz = sizeof(struct tx_desc); 131 + u8 ret = _FAIL; 131 132 132 133 ulfilelength = rtl871x_open_fw(padapter, &phfwfile_hdl, &pmappedfw); 133 134 if (pmappedfw && (ulfilelength > 0)) { 134 135 update_fwhdr(&fwhdr, pmappedfw); 135 136 if (chk_fwhdr(&fwhdr, ulfilelength) == _FAIL) 136 - goto exit_fail; 137 + goto firmware_rel; 137 138 fill_fwpriv(padapter, &fwhdr.fwpriv); 138 139 /* firmware check ok */ 139 140 maxlen = (fwhdr.img_IMEM_size > fwhdr.img_SRAM_size) ? ··· 142 141 maxlen += txdscp_sz; 143 142 ptmpchar = _malloc(maxlen + FWBUFF_ALIGN_SZ); 144 143 if (ptmpchar == NULL) 145 - return _FAIL; 144 + goto firmware_rel; 146 145 147 146 ptx_desc = (struct tx_desc *)(ptmpchar + FWBUFF_ALIGN_SZ - 148 147 ((addr_t)(ptmpchar) & (FWBUFF_ALIGN_SZ - 1))); ··· 274 273 goto exit_fail; 275 274 } else 276 275 goto exit_fail; 277 - return _SUCCESS; 276 + ret = _SUCCESS; 278 277 279 278 exit_fail: 280 279 kfree(ptmpchar); 281 - return _FAIL; 280 + firmware_rel: 281 + release_firmware((struct firmware *)phfwfile_hdl); 282 + return ret; 282 283 } 283 284 284 285 uint rtl8712_hal_init(struct _adapter *padapter)
+114 -33
drivers/staging/rtl8712/usb_intf.c
··· 47 47 static void r871xu_dev_remove(struct usb_interface *pusb_intf); 48 48 49 49 static struct usb_device_id rtl871x_usb_id_tbl[] = { 50 - /*92SU 51 - * Realtek */ 52 - {USB_DEVICE(0x0bda, 0x8171)}, 53 - {USB_DEVICE(0x0bda, 0x8172)}, 50 + 51 + /* RTL8188SU */ 52 + /* Realtek */ 53 + {USB_DEVICE(0x0BDA, 0x8171)}, 54 54 {USB_DEVICE(0x0bda, 0x8173)}, 55 - {USB_DEVICE(0x0bda, 0x8174)}, 56 55 {USB_DEVICE(0x0bda, 0x8712)}, 57 56 {USB_DEVICE(0x0bda, 0x8713)}, 58 57 {USB_DEVICE(0x0bda, 0xC512)}, 59 - /* Abocom */ 58 + /* Abocom */ 60 59 {USB_DEVICE(0x07B8, 0x8188)}, 61 - /* Corega */ 62 - {USB_DEVICE(0x07aa, 0x0047)}, 63 - /* Dlink */ 64 - {USB_DEVICE(0x07d1, 0x3303)}, 65 - {USB_DEVICE(0x07d1, 0x3302)}, 66 - {USB_DEVICE(0x07d1, 0x3300)}, 67 - /* Dlink for Skyworth */ 68 - {USB_DEVICE(0x14b2, 0x3300)}, 69 - {USB_DEVICE(0x14b2, 0x3301)}, 70 - {USB_DEVICE(0x14b2, 0x3302)}, 71 - /* EnGenius */ 72 - {USB_DEVICE(0x1740, 0x9603)}, 73 - {USB_DEVICE(0x1740, 0x9605)}, 60 + /* ASUS */ 61 + {USB_DEVICE(0x0B05, 0x1786)}, 62 + {USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */ 74 63 /* Belkin */ 75 - {USB_DEVICE(0x050d, 0x815F)}, 76 - {USB_DEVICE(0x050d, 0x945A)}, 77 - {USB_DEVICE(0x050d, 0x845A)}, 78 - /* Guillemot */ 79 - {USB_DEVICE(0x06f8, 0xe031)}, 64 + {USB_DEVICE(0x050D, 0x945A)}, 65 + /* Corega */ 66 + {USB_DEVICE(0x07AA, 0x0047)}, 67 + /* D-Link */ 68 + {USB_DEVICE(0x2001, 0x3306)}, 69 + {USB_DEVICE(0x07D1, 0x3306)}, /* 11n mode disable */ 80 70 /* Edimax */ 81 71 {USB_DEVICE(0x7392, 0x7611)}, 82 - {USB_DEVICE(0x7392, 0x7612)}, 83 - {USB_DEVICE(0x7392, 0x7622)}, 72 + /* EnGenius */ 73 + {USB_DEVICE(0x1740, 0x9603)}, 74 + /* Hawking */ 75 + {USB_DEVICE(0x0E66, 0x0016)}, 76 + /* Hercules */ 77 + {USB_DEVICE(0x06F8, 0xE034)}, 78 + {USB_DEVICE(0x06F8, 0xE032)}, 79 + /* Logitec */ 80 + {USB_DEVICE(0x0789, 0x0167)}, 81 + /* PCI */ 82 + {USB_DEVICE(0x2019, 0xAB28)}, 83 + {USB_DEVICE(0x2019, 0xED16)}, 84 84 /* Sitecom */ 85 + {USB_DEVICE(0x0DF6, 0x0057)}, 85 86 {USB_DEVICE(0x0DF6, 0x0045)}, 87 + {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */ 88 + {USB_DEVICE(0x0DF6, 0x004B)}, 89 + {USB_DEVICE(0x0DF6, 0x0063)}, 90 + /* Sweex */ 91 + {USB_DEVICE(0x177F, 0x0154)}, 92 + /* Thinkware */ 93 + {USB_DEVICE(0x0BDA, 0x5077)}, 94 + /* Toshiba */ 95 + {USB_DEVICE(0x1690, 0x0752)}, 96 + /* - */ 97 + {USB_DEVICE(0x20F4, 0x646B)}, 98 + {USB_DEVICE(0x083A, 0xC512)}, 99 + 100 + /* RTL8191SU */ 101 + /* Realtek */ 102 + {USB_DEVICE(0x0BDA, 0x8172)}, 103 + /* Amigo */ 104 + {USB_DEVICE(0x0EB0, 0x9061)}, 105 + /* ASUS/EKB */ 106 + {USB_DEVICE(0x0BDA, 0x8172)}, 107 + {USB_DEVICE(0x13D3, 0x3323)}, 108 + {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ 109 + {USB_DEVICE(0x13D3, 0x3342)}, 110 + /* ASUS/EKBLenovo */ 111 + {USB_DEVICE(0x13D3, 0x3333)}, 112 + {USB_DEVICE(0x13D3, 0x3334)}, 113 + {USB_DEVICE(0x13D3, 0x3335)}, /* 11n mode disable */ 114 + {USB_DEVICE(0x13D3, 0x3336)}, /* 11n mode disable */ 115 + /* ASUS/Media BOX */ 116 + {USB_DEVICE(0x13D3, 0x3309)}, 117 + /* Belkin */ 118 + {USB_DEVICE(0x050D, 0x815F)}, 119 + /* D-Link */ 120 + {USB_DEVICE(0x07D1, 0x3302)}, 121 + {USB_DEVICE(0x07D1, 0x3300)}, 122 + {USB_DEVICE(0x07D1, 0x3303)}, 123 + /* Edimax */ 124 + {USB_DEVICE(0x7392, 0x7612)}, 125 + /* EnGenius */ 126 + {USB_DEVICE(0x1740, 0x9605)}, 127 + /* Guillemot */ 128 + {USB_DEVICE(0x06F8, 0xE031)}, 86 129 /* Hawking */ 87 130 {USB_DEVICE(0x0E66, 0x0015)}, 88 - {USB_DEVICE(0x0E66, 0x0016)}, 89 - {USB_DEVICE(0x0b05, 0x1786)}, 90 - {USB_DEVICE(0x0b05, 0x1791)}, /* 11n mode disable */ 91 - 131 + /* Mediao */ 92 132 {USB_DEVICE(0x13D3, 0x3306)}, 93 - {USB_DEVICE(0x13D3, 0x3309)}, 133 + /* PCI */ 134 + {USB_DEVICE(0x2019, 0xED18)}, 135 + {USB_DEVICE(0x2019, 0x4901)}, 136 + /* Sitecom */ 137 + {USB_DEVICE(0x0DF6, 0x0058)}, 138 + {USB_DEVICE(0x0DF6, 0x0049)}, 139 + {USB_DEVICE(0x0DF6, 0x004C)}, 140 + {USB_DEVICE(0x0DF6, 0x0064)}, 141 + /* Skyworth */ 142 + {USB_DEVICE(0x14b2, 0x3300)}, 143 + {USB_DEVICE(0x14b2, 0x3301)}, 144 + {USB_DEVICE(0x14B2, 0x3302)}, 145 + /* - */ 146 + {USB_DEVICE(0x04F2, 0xAFF2)}, 147 + {USB_DEVICE(0x04F2, 0xAFF5)}, 148 + {USB_DEVICE(0x04F2, 0xAFF6)}, 149 + {USB_DEVICE(0x13D3, 0x3339)}, 150 + {USB_DEVICE(0x13D3, 0x3340)}, /* 11n mode disable */ 151 + {USB_DEVICE(0x13D3, 0x3341)}, /* 11n mode disable */ 94 152 {USB_DEVICE(0x13D3, 0x3310)}, 95 - {USB_DEVICE(0x13D3, 0x3311)}, /* 11n mode disable */ 96 153 {USB_DEVICE(0x13D3, 0x3325)}, 97 - {USB_DEVICE(0x083A, 0xC512)}, 154 + 155 + /* RTL8192SU */ 156 + /* Realtek */ 157 + {USB_DEVICE(0x0BDA, 0x8174)}, 158 + {USB_DEVICE(0x0BDA, 0x8174)}, 159 + /* Belkin */ 160 + {USB_DEVICE(0x050D, 0x845A)}, 161 + /* Corega */ 162 + {USB_DEVICE(0x07AA, 0x0051)}, 163 + /* Edimax */ 164 + {USB_DEVICE(0x7392, 0x7622)}, 165 + /* NEC */ 166 + {USB_DEVICE(0x0409, 0x02B6)}, 98 167 {} 99 168 }; 100 169 ··· 172 103 static struct specific_device_id specific_device_id_tbl[] = { 173 104 {.idVendor = 0x0b05, .idProduct = 0x1791, 174 105 .flags = SPEC_DEV_ID_DISABLE_HT}, 106 + {.idVendor = 0x0df6, .idProduct = 0x0059, 107 + .flags = SPEC_DEV_ID_DISABLE_HT}, 108 + {.idVendor = 0x13d3, .idProduct = 0x3306, 109 + .flags = SPEC_DEV_ID_DISABLE_HT}, 175 110 {.idVendor = 0x13D3, .idProduct = 0x3311, 111 + .flags = SPEC_DEV_ID_DISABLE_HT}, 112 + {.idVendor = 0x13d3, .idProduct = 0x3335, 113 + .flags = SPEC_DEV_ID_DISABLE_HT}, 114 + {.idVendor = 0x13d3, .idProduct = 0x3336, 115 + .flags = SPEC_DEV_ID_DISABLE_HT}, 116 + {.idVendor = 0x13d3, .idProduct = 0x3340, 117 + .flags = SPEC_DEV_ID_DISABLE_HT}, 118 + {.idVendor = 0x13d3, .idProduct = 0x3341, 176 119 .flags = SPEC_DEV_ID_DISABLE_HT}, 177 120 {} 178 121 };
+1 -1
drivers/staging/speakup/kobjects.c
··· 332 332 unsigned long flags; 333 333 334 334 len = strlen(buf); 335 - if (len > 0 || len < 3) { 335 + if (len > 0 && len < 3) { 336 336 ch = buf[0]; 337 337 if (ch == '\n') 338 338 ch = '0';
+9 -10
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
··· 986 986 input_set_abs_params(rmi4_data->input_dev, ABS_MT_TOUCH_MAJOR, 0, 987 987 MAX_TOUCH_MAJOR, 0, 0); 988 988 989 - retval = input_register_device(rmi4_data->input_dev); 990 - if (retval) { 991 - dev_err(&client->dev, "%s:input register failed\n", __func__); 992 - goto err_input_register; 993 - } 994 - 995 989 /* Clear interrupts */ 996 990 synaptics_rmi4_i2c_block_read(rmi4_data, 997 991 rmi4_data->fn01_data_base_addr + 1, intr_status, ··· 997 1003 if (retval) { 998 1004 dev_err(&client->dev, "%s:Unable to get attn irq %d\n", 999 1005 __func__, platformdata->irq_number); 1000 - goto err_request_irq; 1006 + goto err_unset_clientdata; 1007 + } 1008 + 1009 + retval = input_register_device(rmi4_data->input_dev); 1010 + if (retval) { 1011 + dev_err(&client->dev, "%s:input register failed\n", __func__); 1012 + goto err_free_irq; 1001 1013 } 1002 1014 1003 1015 return retval; 1004 1016 1005 - err_request_irq: 1017 + err_free_irq: 1006 1018 free_irq(platformdata->irq_number, rmi4_data); 1007 - input_unregister_device(rmi4_data->input_dev); 1008 - err_input_register: 1019 + err_unset_clientdata: 1009 1020 i2c_set_clientdata(client, NULL); 1010 1021 err_query_dev: 1011 1022 if (platformdata->regulator_en) {
+4 -4
drivers/staging/tidspbridge/core/io_sm.c
··· 949 949 * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then 950 950 * schedules a DPC to dispatch I/O. 951 951 */ 952 - void io_mbox_msg(u32 msg) 952 + int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg) 953 953 { 954 954 struct io_mgr *pio_mgr; 955 955 struct dev_object *dev_obj; ··· 959 959 dev_get_io_mgr(dev_obj, &pio_mgr); 960 960 961 961 if (!pio_mgr) 962 - return; 962 + return NOTIFY_BAD; 963 963 964 - pio_mgr->intr_val = (u16)msg; 964 + pio_mgr->intr_val = (u16)((u32)msg); 965 965 if (pio_mgr->intr_val & MBX_PM_CLASS) 966 966 io_dispatch_pm(pio_mgr); 967 967 ··· 973 973 spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); 974 974 tasklet_schedule(&pio_mgr->dpc_tasklet); 975 975 } 976 - return; 976 + return NOTIFY_OK; 977 977 } 978 978 979 979 /*
+7 -8
drivers/staging/tidspbridge/core/tiomap3430.c
··· 223 223 bridge_msg_set_queue_id, 224 224 }; 225 225 226 + static struct notifier_block dsp_mbox_notifier = { 227 + .notifier_call = io_mbox_msg, 228 + }; 229 + 226 230 static inline void flush_all(struct bridge_dev_context *dev_context) 227 231 { 228 232 if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || ··· 557 553 * Enable Mailbox events and also drain any pending 558 554 * stale messages. 559 555 */ 560 - dev_context->mbox = omap_mbox_get("dsp"); 556 + dev_context->mbox = omap_mbox_get("dsp", &dsp_mbox_notifier); 561 557 if (IS_ERR(dev_context->mbox)) { 562 558 dev_context->mbox = NULL; 563 559 pr_err("%s: Failed to get dsp mailbox handle\n", ··· 567 563 568 564 } 569 565 if (!status) { 570 - dev_context->mbox->rxq->callback = (int (*)(void *))io_mbox_msg; 571 - 572 566 /*PM_IVA2GRPSEL_PER = 0xC0;*/ 573 567 temp = readl(resources->dw_per_pm_base + 0xA8); 574 568 temp = (temp & 0xFFFFFF30) | 0xC0; ··· 687 685 /* Disable the mailbox interrupts */ 688 686 if (dev_context->mbox) { 689 687 omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); 690 - omap_mbox_put(dev_context->mbox); 688 + omap_mbox_put(dev_context->mbox, &dsp_mbox_notifier); 691 689 dev_context->mbox = NULL; 692 690 } 693 691 /* Reset IVA2 clocks*/ ··· 788 786 789 787 pt_attrs = kzalloc(sizeof(struct pg_table_attrs), GFP_KERNEL); 790 788 if (pt_attrs != NULL) { 791 - /* Assuming that we use only DSP's memory map 792 - * until 0x4000:0000 , we would need only 1024 793 - * L1 enties i.e L1 size = 4K */ 794 - pt_attrs->l1_size = 0x1000; 789 + pt_attrs->l1_size = SZ_16K; /* 4096 entries of 32 bits */ 795 790 align_size = pt_attrs->l1_size; 796 791 /* Align sizes are expected to be power of 2 */ 797 792 /* we like to get aligned on L1 table size */
+8 -13
drivers/staging/tidspbridge/include/dspbridge/io_sm.h
··· 72 72 /* 73 73 * ======== io_mbox_msg ======== 74 74 * Purpose: 75 - * Main interrupt handler for the shared memory Bridge channel manager. 76 - * Calls the Bridge's chnlsm_isr to determine if this interrupt is ours, 77 - * then schedules a DPC to dispatch I/O. 75 + * Main message handler for the shared memory Bridge channel manager. 76 + * Determine if this message is ours, then schedules a DPC to 77 + * dispatch I/O. 78 78 * Parameters: 79 - * ref_data: Pointer to the channel manager object for this board. 80 - * Set in an initial call to ISR_Install(). 79 + * self: Pointer to its own notifier_block struct. 80 + * len: Length of message. 81 + * msg: Message code received. 81 82 * Returns: 82 - * TRUE if interrupt handled; FALSE otherwise. 83 - * Requires: 84 - * Must be in locked memory if executing in kernel mode. 85 - * Must only call functions which are in locked memory if Kernel mode. 86 - * Must only call asynchronous services. 87 - * Interrupts are disabled and EOI for this interrupt has been sent. 88 - * Ensures: 83 + * NOTIFY_OK if handled; NOTIFY_BAD otherwise. 89 84 */ 90 - void io_mbox_msg(u32 msg); 85 + int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg); 91 86 92 87 /* 93 88 * ======== io_request_chnl ========
+1
drivers/staging/usbip/stub.h
··· 32 32 33 33 struct stub_device { 34 34 struct usb_interface *interface; 35 + struct usb_device *udev; 35 36 struct list_head list; 36 37 37 38 struct usbip_device ud;
+14 -4
drivers/staging/usbip/stub_dev.c
··· 258 258 static void stub_device_reset(struct usbip_device *ud) 259 259 { 260 260 struct stub_device *sdev = container_of(ud, struct stub_device, ud); 261 - struct usb_device *udev = interface_to_usbdev(sdev->interface); 261 + struct usb_device *udev = sdev->udev; 262 262 int ret; 263 263 264 264 usbip_udbg("device reset"); 265 + 265 266 ret = usb_lock_device_for_reset(udev, sdev->interface); 266 267 if (ret < 0) { 267 268 dev_err(&udev->dev, "lock for reset\n"); ··· 310 309 * 311 310 * Allocates and initializes a new stub_device struct. 312 311 */ 313 - static struct stub_device *stub_device_alloc(struct usb_interface *interface) 312 + static struct stub_device *stub_device_alloc(struct usb_device *udev, 313 + struct usb_interface *interface) 314 314 { 315 315 struct stub_device *sdev; 316 316 int busnum = interface_to_busnum(interface); ··· 326 324 return NULL; 327 325 } 328 326 329 - sdev->interface = interface; 327 + sdev->interface = usb_get_intf(interface); 328 + sdev->udev = usb_get_dev(udev); 330 329 331 330 /* 332 331 * devid is defined with devnum when this driver is first allocated. ··· 453 450 return err; 454 451 } 455 452 453 + usb_get_intf(interface); 456 454 return 0; 457 455 } 458 456 459 457 /* ok. this is my device. */ 460 - sdev = stub_device_alloc(interface); 458 + sdev = stub_device_alloc(udev, interface); 461 459 if (!sdev) 462 460 return -ENOMEM; 463 461 ··· 480 476 dev_err(&interface->dev, "create sysfs files for %s\n", 481 477 udev_busid); 482 478 usb_set_intfdata(interface, NULL); 479 + usb_put_intf(interface); 480 + 483 481 busid_priv->interf_count = 0; 484 482 485 483 busid_priv->sdev = NULL; ··· 551 545 if (busid_priv->interf_count > 1) { 552 546 busid_priv->interf_count--; 553 547 shutdown_busid(busid_priv); 548 + usb_put_intf(interface); 554 549 return; 555 550 } 556 551 ··· 560 553 561 554 /* 1. shutdown the current connection */ 562 555 shutdown_busid(busid_priv); 556 + 557 + usb_put_dev(sdev->udev); 558 + usb_put_intf(interface); 563 559 564 560 /* 3. free sdev */ 565 561 busid_priv->sdev = NULL;
+2 -2
drivers/staging/usbip/stub_rx.c
··· 364 364 365 365 static int get_pipe(struct stub_device *sdev, int epnum, int dir) 366 366 { 367 - struct usb_device *udev = interface_to_usbdev(sdev->interface); 367 + struct usb_device *udev = sdev->udev; 368 368 struct usb_host_endpoint *ep; 369 369 struct usb_endpoint_descriptor *epd = NULL; 370 370 ··· 484 484 int ret; 485 485 struct stub_priv *priv; 486 486 struct usbip_device *ud = &sdev->ud; 487 - struct usb_device *udev = interface_to_usbdev(sdev->interface); 487 + struct usb_device *udev = sdev->udev; 488 488 int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); 489 489 490 490
+3 -3
drivers/staging/usbip/vhci.h
··· 100 100 * But, the index of this array begins from 0. 101 101 */ 102 102 struct vhci_device vdev[VHCI_NPORTS]; 103 - 104 - /* vhci_device which has not been assiged its address yet */ 105 - int pending_port; 106 103 }; 107 104 108 105 ··· 115 118 void rh_port_disconnect(int rhport); 116 119 void vhci_rx_loop(struct usbip_task *ut); 117 120 void vhci_tx_loop(struct usbip_task *ut); 121 + 122 + struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, 123 + __u32 seqnum); 118 124 119 125 #define hardware (&the_controller->pdev.dev) 120 126
+46 -8
drivers/staging/usbip/vhci_hcd.c
··· 138 138 * the_controller->vdev[rhport].ud.status = VDEV_CONNECT; 139 139 * spin_unlock(&the_controller->vdev[rhport].ud.lock); */ 140 140 141 - the_controller->pending_port = rhport; 142 - 143 141 spin_unlock_irqrestore(&the_controller->lock, flags); 144 142 145 143 usb_hcd_poll_rh_status(vhci_to_hcd(the_controller)); ··· 557 559 struct device *dev = &urb->dev->dev; 558 560 int ret = 0; 559 561 unsigned long flags; 562 + struct vhci_device *vdev; 560 563 561 564 usbip_dbg_vhci_hc("enter, usb_hcd %p urb %p mem_flags %d\n", 562 565 hcd, urb, mem_flags); ··· 572 573 spin_unlock_irqrestore(&the_controller->lock, flags); 573 574 return urb->status; 574 575 } 576 + 577 + vdev = port_to_vdev(urb->dev->portnum-1); 578 + 579 + /* refuse enqueue for dead connection */ 580 + spin_lock(&vdev->ud.lock); 581 + if (vdev->ud.status == VDEV_ST_NULL || vdev->ud.status == VDEV_ST_ERROR) { 582 + usbip_uerr("enqueue for inactive port %d\n", vdev->rhport); 583 + spin_unlock(&vdev->ud.lock); 584 + spin_unlock_irqrestore(&the_controller->lock, flags); 585 + return -ENODEV; 586 + } 587 + spin_unlock(&vdev->ud.lock); 575 588 576 589 ret = usb_hcd_link_urb_to_ep(hcd, urb); 577 590 if (ret) ··· 603 592 __u8 type = usb_pipetype(urb->pipe); 604 593 struct usb_ctrlrequest *ctrlreq = 605 594 (struct usb_ctrlrequest *) urb->setup_packet; 606 - struct vhci_device *vdev = 607 - port_to_vdev(the_controller->pending_port); 608 595 609 596 if (type != PIPE_CONTROL || !ctrlreq) { 610 597 dev_err(dev, "invalid request to devnum 0\n"); ··· 616 607 dev_info(dev, "SetAddress Request (%d) to port %d\n", 617 608 ctrlreq->wValue, vdev->rhport); 618 609 619 - vdev->udev = urb->dev; 610 + if (vdev->udev) 611 + usb_put_dev(vdev->udev); 612 + vdev->udev = usb_get_dev(urb->dev); 620 613 621 614 spin_lock(&vdev->ud.lock); 622 615 vdev->ud.status = VDEV_ST_USED; ··· 638 627 "Get_Descriptor to device 0 " 639 628 "(get max pipe size)\n"); 640 629 641 - /* FIXME: reference count? (usb_get_dev()) */ 642 - vdev->udev = urb->dev; 630 + if (vdev->udev) 631 + usb_put_dev(vdev->udev); 632 + vdev->udev = usb_get_dev(urb->dev); 643 633 goto out; 644 634 645 635 default: ··· 817 805 return 0; 818 806 } 819 807 820 - 821 808 static void vhci_device_unlink_cleanup(struct vhci_device *vdev) 822 809 { 823 810 struct vhci_unlink *unlink, *tmp; ··· 824 813 spin_lock(&vdev->priv_lock); 825 814 826 815 list_for_each_entry_safe(unlink, tmp, &vdev->unlink_tx, list) { 816 + usbip_uinfo("unlink cleanup tx %lu\n", unlink->unlink_seqnum); 827 817 list_del(&unlink->list); 828 818 kfree(unlink); 829 819 } 830 820 831 821 list_for_each_entry_safe(unlink, tmp, &vdev->unlink_rx, list) { 822 + struct urb *urb; 823 + 824 + /* give back URB of unanswered unlink request */ 825 + usbip_uinfo("unlink cleanup rx %lu\n", unlink->unlink_seqnum); 826 + 827 + urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); 828 + if (!urb) { 829 + usbip_uinfo("the urb (seqnum %lu) was already given back\n", 830 + unlink->unlink_seqnum); 831 + list_del(&unlink->list); 832 + kfree(unlink); 833 + continue; 834 + } 835 + 836 + urb->status = -ENODEV; 837 + 838 + spin_lock(&the_controller->lock); 839 + usb_hcd_unlink_urb_from_ep(vhci_to_hcd(the_controller), urb); 840 + spin_unlock(&the_controller->lock); 841 + 842 + usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, urb->status); 843 + 832 844 list_del(&unlink->list); 833 845 kfree(unlink); 834 846 } ··· 920 886 921 887 vdev->speed = 0; 922 888 vdev->devid = 0; 889 + 890 + if (vdev->udev) 891 + usb_put_dev(vdev->udev); 892 + vdev->udev = NULL; 923 893 924 894 ud->tcp_socket = NULL; 925 895
+42 -8
drivers/staging/usbip/vhci_rx.c
··· 23 23 #include "vhci.h" 24 24 25 25 26 - /* get URB from transmitted urb queue */ 27 - static struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, 26 + /* get URB from transmitted urb queue. caller must hold vdev->priv_lock */ 27 + struct urb *pickup_urb_and_free_priv(struct vhci_device *vdev, 28 28 __u32 seqnum) 29 29 { 30 30 struct vhci_priv *priv, *tmp; 31 31 struct urb *urb = NULL; 32 32 int status; 33 - 34 - spin_lock(&vdev->priv_lock); 35 33 36 34 list_for_each_entry_safe(priv, tmp, &vdev->priv_rx, list) { 37 35 if (priv->seqnum == seqnum) { ··· 61 63 } 62 64 } 63 65 64 - spin_unlock(&vdev->priv_lock); 65 - 66 66 return urb; 67 67 } 68 68 ··· 70 74 struct usbip_device *ud = &vdev->ud; 71 75 struct urb *urb; 72 76 77 + spin_lock(&vdev->priv_lock); 73 78 74 79 urb = pickup_urb_and_free_priv(vdev, pdu->base.seqnum); 75 80 81 + spin_unlock(&vdev->priv_lock); 76 82 77 83 if (!urb) { 78 84 usbip_uerr("cannot find a urb of seqnum %u\n", ··· 159 161 return; 160 162 } 161 163 164 + spin_lock(&vdev->priv_lock); 165 + 162 166 urb = pickup_urb_and_free_priv(vdev, unlink->unlink_seqnum); 167 + 168 + spin_unlock(&vdev->priv_lock); 169 + 163 170 if (!urb) { 164 171 /* 165 172 * I get the result of a unlink request. But, it seems that I ··· 193 190 return; 194 191 } 195 192 193 + static int vhci_priv_tx_empty(struct vhci_device *vdev) 194 + { 195 + int empty = 0; 196 + 197 + spin_lock(&vdev->priv_lock); 198 + 199 + empty = list_empty(&vdev->priv_rx); 200 + 201 + spin_unlock(&vdev->priv_lock); 202 + 203 + return empty; 204 + } 205 + 196 206 /* recv a pdu */ 197 207 static void vhci_rx_pdu(struct usbip_device *ud) 198 208 { ··· 218 202 219 203 memset(&pdu, 0, sizeof(pdu)); 220 204 221 - 222 205 /* 1. receive a pdu header */ 223 206 ret = usbip_xmit(0, ud->tcp_socket, (char *) &pdu, sizeof(pdu), 0); 207 + if (ret < 0) { 208 + if (ret == -ECONNRESET) 209 + usbip_uinfo("connection reset by peer\n"); 210 + else if (ret == -EAGAIN) { 211 + /* ignore if connection was idle */ 212 + if (vhci_priv_tx_empty(vdev)) 213 + return; 214 + usbip_uinfo("connection timed out with pending urbs\n"); 215 + } else if (ret != -ERESTARTSYS) 216 + usbip_uinfo("xmit failed %d\n", ret); 217 + 218 + usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); 219 + return; 220 + } 221 + if (ret == 0) { 222 + usbip_uinfo("connection closed"); 223 + usbip_event_add(ud, VDEV_EVENT_DOWN); 224 + return; 225 + } 224 226 if (ret != sizeof(pdu)) { 225 - usbip_uerr("receiving pdu failed! size is %d, should be %d\n", 227 + usbip_uerr("received pdu size is %d, should be %d\n", 226 228 ret, (unsigned int)sizeof(pdu)); 227 229 usbip_event_add(ud, VDEV_EVENT_ERROR_TCP); 228 230 return;
+3 -3
drivers/staging/xgifb/vb_setmode.c
··· 3954 3954 unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo) 3955 3955 { 3956 3956 3957 - if ((((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) 3958 - && (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ 3957 + if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) && 3958 + (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ 3959 3959 return 1; 3960 3960 3961 3961 return 0; ··· 8773 8773 8774 8774 if (pVBInfo->IF_DEF_LVDS == 0) { 8775 8775 CRT2Index = CRT2Index >> 6; /* for LCD */ 8776 - if (((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) { /*301b*/ 8776 + if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /*301b*/ 8777 8777 if (pVBInfo->LCDResInfo != Panel1024x768) 8778 8778 VCLKIndex = LCDXlat2VCLK[CRT2Index]; 8779 8779 else