From ae40030429b19a8d22517e99bd604cac8b37fd6e Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Tue, 11 Sep 2018 11:50:43 +1000 Subject: Remove configure_pcm function, absorb into pcm_open No longer any need for the configure_pcm function in it's current form. Signed-off-by: Mark Farrugia --- alsa-pcm.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'alsa-pcm.c') diff --git a/alsa-pcm.c b/alsa-pcm.c index 9e3471b..9b55a14 100644 --- a/alsa-pcm.c +++ b/alsa-pcm.c @@ -22,12 +22,19 @@ } \ } while (0) +/******************************************************************************* + * ALSA PCM Callbacks + ******************************************************************************/ /** - * configure_pcm - set up substream properties from user configuration + * pcm_open - Implements 'open' callback for PCM middle layer * @substream: pointer to ALSA PCM substream - * @return 0 on success or error code otherwise + * + * This is called when an ALSA PCM substream is opened. The substream device is + * configured here. + * + * Returns 0 on success or error code otherwise. */ -static int configure_pcm(struct snd_pcm_substream *substream) +static int pcm_open(struct snd_pcm_substream *substream) { struct avirt_alsa_devconfig *config; struct avirt_audiopath *audiopath; @@ -74,27 +81,6 @@ static int configure_pcm(struct snd_pcm_substream *substream) hw->period_bytes_min = blocksize * bytes_per_sample * config->channels; hw->period_bytes_max = blocksize * bytes_per_sample * config->channels; - return 0; -} - -/******************************************************************************* - * ALSA PCM Callbacks - ******************************************************************************/ -/** - * pcm_open - Implements 'open' callback for PCM middle layer - * @substream: pointer to ALSA PCM substream - * - * This is called when an ALSA PCM substream is opened. The substream device is - * configured here. - * - * Returns 0 on success or error code otherwise. - */ -static int pcm_open(struct snd_pcm_substream *substream) -{ - DINFO(AP_LOGNAME, ""); - // Setup the pcm device based on the configuration assigned - CHK_ERR_V(configure_pcm(substream), "Failed to setup pcm device"); - // Do additional Audio Path 'open' callback DO_AUDIOPATH_CB(open, substream); -- cgit 1.2.3-korg