aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/main_usb.c
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2020-05-16 11:50:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-19 16:17:19 +0200
commitcf5ffd22e409e2cb7a7adc1f69fbcb92c335e273 (patch)
treefa946b3a8e869e4f09d52b29c616e34248206fbf /drivers/staging/vt6656/main_usb.c
parentstaging: vt6656: vnt_usb_send_context remove variable data. (diff)
downloadlinux-dev-cf5ffd22e409e2cb7a7adc1f69fbcb92c335e273.tar.xz
linux-dev-cf5ffd22e409e2cb7a7adc1f69fbcb92c335e273.zip
staging: vt6656: use usb_anchor for tx queue.
Use usb_anchor to track tx submitted urbs and initialize the urb as needed in vnt_tx_context. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Link: https://lore.kernel.org/r/077f42f8-4f7f-adc4-5a14-955165cef9f1@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/main_usb.c')
-rw-r--r--drivers/staging/vt6656/main_usb.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 930ee424ecdf..c0169e32621b 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -445,17 +445,13 @@ static void vnt_free_tx_bufs(struct vnt_private *priv)
struct vnt_usb_send_context *tx_context;
int ii;
+ usb_kill_anchored_urbs(&priv->tx_submitted);
+
for (ii = 0; ii < priv->num_tx_context; ii++) {
tx_context = priv->tx_context[ii];
if (!tx_context)
continue;
- /* deallocate URBs */
- if (tx_context->urb) {
- usb_kill_urb(tx_context->urb);
- usb_free_urb(tx_context->urb);
- }
-
kfree(tx_context);
}
}
@@ -496,6 +492,8 @@ static int vnt_alloc_bufs(struct vnt_private *priv)
struct vnt_rcb *rcb;
int ii;
+ init_usb_anchor(&priv->tx_submitted);
+
for (ii = 0; ii < priv->num_tx_context; ii++) {
tx_context = kmalloc(sizeof(*tx_context), GFP_KERNEL);
if (!tx_context) {
@@ -506,14 +504,6 @@ static int vnt_alloc_bufs(struct vnt_private *priv)
priv->tx_context[ii] = tx_context;
tx_context->priv = priv;
tx_context->pkt_no = ii;
-
- /* allocate URBs */
- tx_context->urb = usb_alloc_urb(0, GFP_KERNEL);
- if (!tx_context->urb) {
- ret = -ENOMEM;
- goto free_tx;
- }
-
tx_context->in_use = false;
}