diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 12:11:44 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 12:11:44 -0800 |
commit | b5c78e04dd061b776978dad61dd85357081147b0 (patch) | |
tree | 2416b2dc61c452c3aeb2a32bcedf15e6257be638 /drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | |
parent | 06991c28f37ad68e5c03777f5c3b679b56e3dac1 (diff) | |
parent | 951348b377385475aa256c27e1c9e2564c9ec160 (diff) |
Merge tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging tree update from Greg Kroah-Hartman:
"Here's the big staging tree merge for 3.9-rc1
Lots of cleanups and updates for drivers all through the staging tree.
We are pretty much "code neutral" here, adding just about as many
lines as we removed.
All of these have been in linux-next for a while."
* tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (804 commits)
staging: comedi: vmk80xx: wait for URBs to complete
staging: comedi: drivers: addi-data: hwdrv_apci3200.c: Add a missing semicolon
staging: et131x: Update TODO list
staging: et131x: Remove assignment of skb->dev
staging: wlan-ng: hfa384x.h: fix for error reported by smatch
staging/zache checkpatch ERROR: spaces prohibited around that
staging/ozwpan: Mark read only parameters and structs as const
staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat
staging/ozwpan: Mark local functions as static (fix sparse warnings)
staging/ozwpan: Add missing header includes
staging/usbip: Mark local functions as static (fix sparse warnings)
staging/xgifb: Remove duplicated code in loops.
staging/xgifb: Consolidate return paths
staging/xgifb: Remove code without effect
staging/xgifb: Remove unnecessary casts
staging/xgifb: Consolidate if/else if with identical code branches
staging: vt6656: replaced custom TRUE definition with true
staging: vt6656: replaced custom FALSE definition with false
staging: vt6656: replace custom BOOL definition with bool
staging/rtl8187se: Mark functions as static to silence sparse
...
Diffstat (limited to 'drivers/staging/ft1000/ft1000-usb/ft1000_usb.c')
-rw-r--r-- | drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c index b2ecd0e6780e..614db55a8171 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c @@ -63,16 +63,13 @@ static int ft1000_probe(struct usb_interface *interface, unsigned numaltsetting; int i, ret = 0, size; - struct ft1000_device *ft1000dev; + struct ft1000_usb *ft1000dev; struct ft1000_info *pft1000info = NULL; const struct firmware *dsp_fw; - ft1000dev = kzalloc(sizeof(struct ft1000_device), GFP_KERNEL); - - if (!ft1000dev) { - pr_err("out of memory allocating device structure\n"); + ft1000dev = kzalloc(sizeof(struct ft1000_usb), GFP_KERNEL); + if (!ft1000dev) return -ENOMEM; - } dev = interface_to_usbdev(interface); DEBUG("ft1000_probe: usb device descriptor info:\n"); @@ -171,11 +168,11 @@ static int ft1000_probe(struct usb_interface *interface, } gPollingfailed = FALSE; - pft1000info->pPollThread = + ft1000dev->pPollThread = kthread_run(ft1000_poll_thread, ft1000dev, "ft1000_poll"); - if (IS_ERR(pft1000info->pPollThread)) { - ret = PTR_ERR(pft1000info->pPollThread); + if (IS_ERR(ft1000dev->pPollThread)) { + ret = PTR_ERR(ft1000dev->pPollThread); goto err_load; } @@ -200,7 +197,7 @@ static int ft1000_probe(struct usb_interface *interface, if (ret) goto err_proc; - pft1000info->NetDevRegDone = 1; + ft1000dev->NetDevRegDone = 1; return 0; @@ -208,7 +205,7 @@ err_proc: unregister_netdev(ft1000dev->net); free_netdev(ft1000dev->net); err_thread: - kthread_stop(pft1000info->pPollThread); + kthread_stop(ft1000dev->pPollThread); err_load: kfree(pFileStart); err_fw: @@ -219,6 +216,7 @@ err_fw: static void ft1000_disconnect(struct usb_interface *interface) { struct ft1000_info *pft1000info; + struct ft1000_usb *ft1000dev; DEBUG("ft1000_disconnect is called\n"); @@ -226,28 +224,29 @@ static void ft1000_disconnect(struct usb_interface *interface) DEBUG("In disconnect pft1000info=%p\n", pft1000info); if (pft1000info) { + ft1000dev = pft1000info->priv; ft1000_cleanup_proc(pft1000info); - if (pft1000info->pPollThread) - kthread_stop(pft1000info->pPollThread); + if (ft1000dev->pPollThread) + kthread_stop(ft1000dev->pPollThread); DEBUG("ft1000_disconnect: threads are terminated\n"); - if (pft1000info->pFt1000Dev->net) { + if (ft1000dev->net) { DEBUG("ft1000_disconnect: destroy char driver\n"); - ft1000_destroy_dev(pft1000info->pFt1000Dev->net); - unregister_netdev(pft1000info->pFt1000Dev->net); + ft1000_destroy_dev(ft1000dev->net); + unregister_netdev(ft1000dev->net); DEBUG ("ft1000_disconnect: network device unregistered\n"); - free_netdev(pft1000info->pFt1000Dev->net); + free_netdev(ft1000dev->net); } - usb_free_urb(pft1000info->pFt1000Dev->rx_urb); - usb_free_urb(pft1000info->pFt1000Dev->tx_urb); + usb_free_urb(ft1000dev->rx_urb); + usb_free_urb(ft1000dev->tx_urb); DEBUG("ft1000_disconnect: urb freed\n"); - kfree(pft1000info->pFt1000Dev); + kfree(ft1000dev); } kfree(pFileStart); |