diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-11-20 12:32:06 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-11-21 05:43:40 -0500 |
commit | a9bb36261ef5c7e25564d5ce8a5129920a29bff9 (patch) | |
tree | 085c83dbf44cc98c77b490ce663bccf3c235a2ea /sound/usb/endpoint.c | |
parent | 20d32022a8d8639a33d0e429f2d3c51b527ea362 (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.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index d7382a5e29bb..4d50bbe2c115 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) | |||
515 | /* | 515 | /* |
516 | * unlink active urbs. | 516 | * unlink active urbs. |
517 | */ | 517 | */ |
518 | static int deactivate_urbs(struct snd_usb_endpoint *ep, int force, int can_sleep) | 518 | static int deactivate_urbs(struct snd_usb_endpoint *ep, bool force, bool can_sleep) |
519 | { | 519 | { |
520 | unsigned int i; | 520 | unsigned int i; |
521 | int async; | 521 | int async; |
@@ -561,7 +561,7 @@ static void release_urbs(struct snd_usb_endpoint *ep, int force) | |||
561 | ep->prepare_data_urb = NULL; | 561 | ep->prepare_data_urb = NULL; |
562 | 562 | ||
563 | /* stop urbs */ | 563 | /* stop urbs */ |
564 | deactivate_urbs(ep, force, 1); | 564 | deactivate_urbs(ep, force, true); |
565 | wait_clear_urbs(ep); | 565 | wait_clear_urbs(ep); |
566 | 566 | ||
567 | for (i = 0; i < ep->nurbs; i++) | 567 | for (i = 0; i < ep->nurbs; i++) |
@@ -824,7 +824,7 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep, | |||
824 | * | 824 | * |
825 | * Returns an error if the URB submission failed, 0 in all other cases. | 825 | * Returns an error if the URB submission failed, 0 in all other cases. |
826 | */ | 826 | */ |
827 | int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep) | 827 | int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep) |
828 | { | 828 | { |
829 | int err; | 829 | int err; |
830 | unsigned int i; | 830 | unsigned int i; |
@@ -837,7 +837,7 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep) | |||
837 | return 0; | 837 | return 0; |
838 | 838 | ||
839 | /* just to be sure */ | 839 | /* just to be sure */ |
840 | deactivate_urbs(ep, 0, can_sleep); | 840 | deactivate_urbs(ep, false, can_sleep); |
841 | if (can_sleep) | 841 | if (can_sleep) |
842 | wait_clear_urbs(ep); | 842 | wait_clear_urbs(ep); |
843 | 843 | ||
@@ -891,7 +891,7 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, int can_sleep) | |||
891 | __error: | 891 | __error: |
892 | clear_bit(EP_FLAG_RUNNING, &ep->flags); | 892 | clear_bit(EP_FLAG_RUNNING, &ep->flags); |
893 | ep->use_count--; | 893 | ep->use_count--; |
894 | deactivate_urbs(ep, 0, 0); | 894 | deactivate_urbs(ep, false, false); |
895 | return -EPIPE; | 895 | return -EPIPE; |
896 | } | 896 | } |
897 | 897 | ||
@@ -906,8 +906,7 @@ __error: | |||
906 | * | 906 | * |
907 | * Must be balanced to calls of snd_usb_endpoint_start(). | 907 | * Must be balanced to calls of snd_usb_endpoint_start(). |
908 | */ | 908 | */ |
909 | void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, | 909 | void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, bool wait) |
910 | int force, int can_sleep, int wait) | ||
911 | { | 910 | { |
912 | if (!ep) | 911 | if (!ep) |
913 | return; | 912 | return; |
@@ -916,7 +915,7 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep, | |||
916 | return; | 915 | return; |
917 | 916 | ||
918 | if (--ep->use_count == 0) { | 917 | if (--ep->use_count == 0) { |
919 | deactivate_urbs(ep, force, can_sleep); | 918 | deactivate_urbs(ep, false, wait); |
920 | ep->data_subs = NULL; | 919 | ep->data_subs = NULL; |
921 | ep->sync_slave = NULL; | 920 | ep->sync_slave = NULL; |
922 | ep->retire_data_urb = NULL; | 921 | ep->retire_data_urb = NULL; |
@@ -947,7 +946,7 @@ int snd_usb_endpoint_deactivate(struct snd_usb_endpoint *ep) | |||
947 | if (!ep) | 946 | if (!ep) |
948 | return -EINVAL; | 947 | return -EINVAL; |
949 | 948 | ||
950 | deactivate_urbs(ep, 1, 1); | 949 | deactivate_urbs(ep, true, true); |
951 | wait_clear_urbs(ep); | 950 | wait_clear_urbs(ep); |
952 | 951 | ||
953 | if (ep->use_count != 0) | 952 | if (ep->use_count != 0) |