Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "ALSA: usb-audio: Clean up endpoint setups at PCM prepare"

This reverts commit 32eeeed963ad4f41b422b3e314d96ded7283b201.

As the fix for endpoint configuration split is reverted at next, do
another revert here for a clean patch application.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

+30 -10
+30 -10
sound/usb/pcm.c
··· 433 433 } 434 434 } 435 435 436 + static int configure_endpoints(struct snd_usb_audio *chip, 437 + struct snd_usb_substream *subs) 438 + { 439 + int err; 440 + 441 + if (subs->data_endpoint->need_setup) { 442 + /* stop any running stream beforehand */ 443 + if (stop_endpoints(subs, false)) 444 + sync_pending_stops(subs); 445 + if (subs->sync_endpoint) { 446 + err = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); 447 + if (err < 0) 448 + return err; 449 + } 450 + err = snd_usb_endpoint_prepare(chip, subs->data_endpoint); 451 + if (err < 0) 452 + return err; 453 + snd_usb_set_format_quirk(subs, subs->cur_audiofmt); 454 + } else { 455 + if (subs->sync_endpoint) { 456 + err = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); 457 + if (err < 0) 458 + return err; 459 + } 460 + } 461 + 462 + return 0; 463 + } 464 + 436 465 /* 437 466 * hw_params callback 438 467 * ··· 640 611 goto unlock; 641 612 } 642 613 643 - if (subs->sync_endpoint) { 644 - ret = snd_usb_endpoint_prepare(chip, subs->sync_endpoint); 645 - if (ret < 0) 646 - goto unlock; 647 - } 648 - 649 - ret = snd_usb_endpoint_prepare(chip, subs->data_endpoint); 614 + ret = configure_endpoints(chip, subs); 650 615 if (ret < 0) 651 616 goto unlock; 652 - else if (ret > 0) 653 - snd_usb_set_format_quirk(subs, subs->cur_audiofmt); 654 - ret = 0; 655 617 656 618 /* reset the pointer */ 657 619 subs->buffer_bytes = frames_to_bytes(runtime, runtime->buffer_size);