Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342601
b: refs/heads/master
c: b2eb950
h: refs/heads/master
i:
  342599: f90fdb7
v: v3
  • Loading branch information
Takashi Iwai committed Nov 21, 2012
1 parent 93bd8ed commit 3c886f7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 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: ccc1696d527d64deb417bfa1ef9e479d10ad4f6b
refs/heads/master: b2eb950de2f09435d5156f4dc6d5dbf284cd97f3
11 changes: 5 additions & 6 deletions trunk/sound/usb/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,11 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep)
* actually be deactivated.
*
* Must be balanced to calls of snd_usb_endpoint_start().
*
* The caller needs to synchronize the pending stop operation via
* snd_usb_endpoint_sync_pending_stop().
*/
void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, bool wait)
void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep)
{
if (!ep)
return;
Expand All @@ -911,11 +914,7 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, bool wait)
ep->sync_slave = NULL;
ep->retire_data_urb = NULL;
ep->prepare_data_urb = NULL;

if (wait)
wait_clear_urbs(ep);
else
set_bit(EP_FLAG_STOPPING, &ep->flags);
set_bit(EP_FLAG_STOPPING, &ep->flags);
}
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/usb/endpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
struct snd_usb_endpoint *sync_ep);

int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep);
void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, bool wait);
void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep);
void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep);
int snd_usb_endpoint_activate(struct snd_usb_endpoint *ep);
int snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep);
Expand Down
9 changes: 7 additions & 2 deletions trunk/sound/usb/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,15 @@ static int start_endpoints(struct snd_usb_substream *subs, bool can_sleep)
static void stop_endpoints(struct snd_usb_substream *subs, bool wait)
{
if (test_and_clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags))
snd_usb_endpoint_stop(subs->sync_endpoint, wait);
snd_usb_endpoint_stop(subs->sync_endpoint);

if (test_and_clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags))
snd_usb_endpoint_stop(subs->data_endpoint, wait);
snd_usb_endpoint_stop(subs->data_endpoint);

if (wait) {
snd_usb_endpoint_sync_pending_stop(subs->sync_endpoint);
snd_usb_endpoint_sync_pending_stop(subs->data_endpoint);
}
}

static int deactivate_endpoints(struct snd_usb_substream *subs)
Expand Down

0 comments on commit 3c886f7

Please sign in to comment.