Commit 26de5d0a8df0817a58422f6ad43019c47716ce1f

Authored by Eldad Zack
Committed by Takashi Iwai
1 parent 9372103990

ALSA: usb-audio: remove deactivate_endpoints()

The only call site for deactivate_endpoints() at snd_usb_hw_free().
The return value is not checked there, as it is irrelevant if it
fails on hw_free.
This patch moves the deactivation of the endpoints directly into
snd_usb_hw_free().

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 2 additions and 17 deletions Side-by-side Diff

... ... @@ -282,22 +282,6 @@
282 282 }
283 283 }
284 284  
285   -static int deactivate_endpoints(struct snd_usb_substream *subs)
286   -{
287   - int reta, retb;
288   -
289   - reta = snd_usb_endpoint_deactivate(subs->sync_endpoint);
290   - retb = snd_usb_endpoint_deactivate(subs->data_endpoint);
291   -
292   - if (reta < 0)
293   - return reta;
294   -
295   - if (retb < 0)
296   - return retb;
297   -
298   - return 0;
299   -}
300   -
301 285 static int search_roland_implicit_fb(struct usb_device *dev, int ifnum,
302 286 unsigned int altsetting,
303 287 struct usb_host_interface **alts,
... ... @@ -736,7 +720,8 @@
736 720 down_read(&subs->stream->chip->shutdown_rwsem);
737 721 if (!subs->stream->chip->shutdown) {
738 722 stop_endpoints(subs, true);
739   - deactivate_endpoints(subs);
  723 + snd_usb_endpoint_deactivate(subs->sync_endpoint);
  724 + snd_usb_endpoint_deactivate(subs->data_endpoint);
740 725 }
741 726 up_read(&subs->stream->chip->shutdown_rwsem);
742 727 return snd_pcm_lib_free_vmalloc_buffer(substream);