]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/drivers/aloop.c
ALSA: vx: More constifications
[linux.git] / sound / drivers / aloop.c
index 0ebfbe70db00607b1502791fd611fda5871ed400..d78a27271d6d9046772e8f9322adc7110725d789 100644 (file)
@@ -727,10 +727,6 @@ static void loopback_snd_timer_period_elapsed(struct loopback_cable *cable,
 
        dpcm_play = cable->streams[SNDRV_PCM_STREAM_PLAYBACK];
        dpcm_capt = cable->streams[SNDRV_PCM_STREAM_CAPTURE];
-       substream_play = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ?
-                       dpcm_play->substream : NULL;
-       substream_capt = (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) ?
-                       dpcm_capt->substream : NULL;
 
        if (event == SNDRV_TIMER_EVENT_MSTOP) {
                if (!dpcm_play ||
@@ -741,6 +737,10 @@ static void loopback_snd_timer_period_elapsed(struct loopback_cable *cable,
                }
        }
 
+       substream_play = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ?
+                       dpcm_play->substream : NULL;
+       substream_capt = (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) ?
+                       dpcm_capt->substream : NULL;
        valid_runtime = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ?
                                dpcm_play->substream->runtime :
                                dpcm_capt->substream->runtime;
@@ -804,7 +804,7 @@ static void loopback_snd_timer_tasklet(unsigned long arg)
 
 static void loopback_snd_timer_event(struct snd_timer_instance *timeri,
                                     int event,
-                                    struct timespec *tstamp,
+                                    struct timespec64 *tstamp,
                                     unsigned long resolution)
 {
        /* Do not lock cable->lock here because timer->lock is already hold.
@@ -905,12 +905,6 @@ static void loopback_runtime_free(struct snd_pcm_runtime *runtime)
        kfree(dpcm);
 }
 
-static int loopback_hw_params(struct snd_pcm_substream *substream,
-                             struct snd_pcm_hw_params *params)
-{
-       return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
-}
-
 static int loopback_hw_free(struct snd_pcm_substream *substream)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
@@ -920,7 +914,7 @@ static int loopback_hw_free(struct snd_pcm_substream *substream)
        mutex_lock(&dpcm->loopback->cable_lock);
        cable->valid &= ~(1 << substream->stream);
        mutex_unlock(&dpcm->loopback->cable_lock);
-       return snd_pcm_lib_free_pages(substream);
+       return 0;
 }
 
 static unsigned int get_cable_index(struct snd_pcm_substream *substream)
@@ -1305,8 +1299,6 @@ static int loopback_close(struct snd_pcm_substream *substream)
 static const struct snd_pcm_ops loopback_pcm_ops = {
        .open =         loopback_open,
        .close =        loopback_close,
-       .ioctl =        snd_pcm_lib_ioctl,
-       .hw_params =    loopback_hw_params,
        .hw_free =      loopback_hw_free,
        .prepare =      loopback_prepare,
        .trigger =      loopback_trigger,
@@ -1325,8 +1317,7 @@ static int loopback_pcm_new(struct loopback *loopback,
                return err;
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &loopback_pcm_ops);
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &loopback_pcm_ops);
-       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_VMALLOC,
-                                             NULL, 0, 0);
+       snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, NULL, 0, 0);
 
        pcm->private_data = loopback;
        pcm->info_flags = 0;
@@ -1505,7 +1496,7 @@ static int loopback_channels_get(struct snd_kcontrol *kcontrol,
        return 0;
 }
 
-static struct snd_kcontrol_new loopback_controls[]  = {
+static const struct snd_kcontrol_new loopback_controls[]  = {
 {
        .iface =        SNDRV_CTL_ELEM_IFACE_PCM,
        .name =         "PCM Rate Shift 100000",