summaryrefslogtreecommitdiffstats
path: root/sound/usb/endpoint.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-20 18:32:06 +0100
committerTakashi Iwai <tiwai@suse.de>2012-11-21 11:43:40 +0100
commita9bb36261ef5c7e25564d5ce8a5129920a29bff9 (patch)
tree085c83dbf44cc98c77b490ce663bccf3c235a2ea /sound/usb/endpoint.c
parent20d32022a8d8639a33d0e429f2d3c51b527ea362 (diff)
ALSA: usb-audio: simplify snd_usb_endpoint_start/stop arguments
Reduce the redundant arguments for snd_usb_endpoint_start() and snd_usb_endpoint_stop(). Also replaced from int to bool. No functional changes by this commit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r--sound/usb/endpoint.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index d7382a5e29b..4d50bbe2c11 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -515,7 +515,7 @@ void snd_usb_endpoint_sync_pending_stop(struct snd_usb_endpoint *ep)
/*
* unlink active urbs.
*/
-static int deactivate_urbs(struct snd_usb_endpoint *ep, int force, int can_sleep)
+static int deactivate_urbs(struct snd_usb_endpoint *ep, bool force, bool can_sleep)
{
unsigned int i;
int async;
@@ -561,7 +561,7 @@ static void release_urbs(struct snd_usb_endpoint *ep, int force)
ep->prepare_data_urb = NULL;
/* stop urbs */
- deactivate_urbs(ep, force, 1);
+ deactivate_urbs(ep, force, true);
wait_clear_urbs(ep);
for (i = 0; i < ep->nurbs; i++)
@@ -824,7 +824,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
*
* Returns an error if the URB submission failed, 0 in all other cases.
*/
-int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep)
+int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep)
{
int err;
unsigned int i;
@@ -837,7 +837,7 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep)
return 0;
/* just to be sure */
- deactivate_urbs(ep, 0, can_sleep);
+ deactivate_urbs(ep, false, can_sleep);
if (can_sleep)
wait_clear_urbs(ep);
@@ -891,7 +891,7 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep)
__error:
clear_bit(EP_FLAG_RUNNING, &ep->flags);
ep->use_count--;
- deactivate_urbs(ep, 0, 0);
+ deactivate_urbs(ep, false, false);
return -EPIPE;
}
@@ -906,8 +906,7 @@ __error:
*
* Must be balanced to calls of snd_usb_endpoint_start().
*/
-void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep,
- int force, int can_sleep, int wait)
+void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, bool wait)
{
if (!ep)
return;
@@ -916,7 +915,7 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep,
return;
if (--ep->use_count == 0) {
- deactivate_urbs(ep, force, can_sleep);
+ deactivate_urbs(ep, false, wait);
ep->data_subs = NULL;
ep->sync_slave = NULL;
ep->retire_data_urb = NULL;
@@ -947,7 +946,7 @@ int snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep)
if (!ep)
return -EINVAL;
- deactivate_urbs(ep, 1, 1);
+ deactivate_urbs(ep, true, true);
wait_clear_urbs(ep);
if (ep->use_count != 0)