Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317302
b: refs/heads/master
c: 0c16ae7
h: refs/heads/master
v: v3
  • Loading branch information
Ben Chan authored and Greg Kroah-Hartman committed Jun 12, 2012
1 parent b03152c commit e531a8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 592314e9e1c0057bdb75ff00cbd1c51aa06c65e7
refs/heads/master: 0c16ae762990660c4dfd7515e3d46b4249f535f0
26 changes: 10 additions & 16 deletions trunk/drivers/staging/gdm72xx/gdm_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,21 +270,17 @@ static void release_usb(struct usbwm_dev *udev)
}
}

static void gdm_usb_send_complete_impl(struct urb *urb, bool need_lock)
static void __gdm_usb_send_complete(struct urb *urb)
{
struct usb_tx *t = urb->context;
struct tx_cxt *tx = t->tx_cxt;
u8 *pkt = t->buf;
u16 cmd_evt;
unsigned long flags;

/* Completion by usb_unlink_urb */
if (urb->status == -ECONNRESET)
return;

if (need_lock)
spin_lock_irqsave(&tx->lock, flags);

if (t->callback)
t->callback(t->cb_data);

Expand All @@ -296,19 +292,17 @@ static void gdm_usb_send_complete_impl(struct urb *urb, bool need_lock)
put_tx_struct(tx, t);
else
free_tx_struct(t);

if (need_lock)
spin_unlock_irqrestore(&tx->lock, flags);
}

static void gdm_usb_send_complete(struct urb *urb)
{
gdm_usb_send_complete_impl(urb, true);
}
struct usb_tx *t = urb->context;
struct tx_cxt *tx = t->tx_cxt;
unsigned long flags;

static void gdm_usb_send_complete_no_lock(struct urb *urb)
{
gdm_usb_send_complete_impl(urb, false);
spin_lock_irqsave(&tx->lock, flags);
__gdm_usb_send_complete(urb);
spin_unlock_irqrestore(&tx->lock, flags);
}

static int gdm_usb_send(void *priv_dev, void *data, int len,
Expand Down Expand Up @@ -423,7 +417,7 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,

send_fail:
t->callback = NULL;
gdm_usb_send_complete_no_lock(t->urb);
__gdm_usb_send_complete(t->urb);
spin_unlock_irqrestore(&tx->lock, flags);
return ret;
}
Expand Down Expand Up @@ -552,7 +546,7 @@ static void do_pm_control(struct work_struct *work)

if (ret) {
t->callback = NULL;
gdm_usb_send_complete_no_lock(t->urb);
__gdm_usb_send_complete(t->urb);
}
}
}
Expand Down Expand Up @@ -754,7 +748,7 @@ static int k_mode_thread(void *arg)

if (ret) {
t->callback = NULL;
gdm_usb_send_complete_no_lock(t->urb);
__gdm_usb_send_complete(t->urb);
}
}

Expand Down

0 comments on commit e531a8b

Please sign in to comment.