]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/spi/at73c213.c
sn_pci_controller_fixup() should be __init
[linux-2.6-omap-h63xx.git] / sound / spi / at73c213.c
index 1355fe0c6674e2a9831651d5720afdb102017274..09802e8a6fb834419f8c752ac8edb7c68405de88 100644 (file)
@@ -210,7 +210,13 @@ static int snd_at73c213_pcm_open(struct snd_pcm_substream *substream)
 {
        struct snd_at73c213 *chip = snd_pcm_substream_chip(substream);
        struct snd_pcm_runtime *runtime = substream->runtime;
+       int err;
 
+       /* ensure buffer_size is a multiple of period_size */
+       err = snd_pcm_hw_constraint_integer(runtime,
+                                       SNDRV_PCM_HW_PARAM_PERIODS);
+       if (err < 0)
+               return err;
        snd_at73c213_playback_hw.rate_min = chip->bitrate;
        snd_at73c213_playback_hw.rate_max = chip->bitrate;
        runtime->hw = snd_at73c213_playback_hw;
@@ -325,15 +331,6 @@ static struct snd_pcm_ops at73c213_playback_ops = {
        .pointer        = snd_at73c213_pcm_pointer,
 };
 
-static void snd_at73c213_pcm_free(struct snd_pcm *pcm)
-{
-       struct snd_at73c213 *chip = snd_pcm_chip(pcm);
-       if (chip->pcm) {
-               snd_pcm_lib_preallocate_free_for_all(chip->pcm);
-               chip->pcm = NULL;
-       }
-}
-
 static int __devinit snd_at73c213_pcm_new(struct snd_at73c213 *chip, int device)
 {
        struct snd_pcm *pcm;
@@ -345,7 +342,6 @@ static int __devinit snd_at73c213_pcm_new(struct snd_at73c213 *chip, int device)
                goto out;
 
        pcm->private_data = chip;
-       pcm->private_free = snd_at73c213_pcm_free;
        pcm->info_flags = SNDRV_PCM_INFO_BLOCK_TRANSFER;
        strcpy(pcm->name, "at73c213");
        chip->pcm = pcm;