]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/au88x0/au88x0_pcm.c
ALSA: Clean up SG-buffer helper functions and macros
[linux-2.6-omap-h63xx.git] / sound / pci / au88x0 / au88x0_pcm.c
index 7b5baa1738597b61e5785bcc270bb12b8ddae753..b9d2f202cf9b4385db4291d5fb919cf6365525ab 100644 (file)
@@ -21,7 +21,6 @@
  * It remains stuck,and DMA transfers do not happen. 
  */
 #include <sound/asoundef.h>
-#include <sound/driver.h>
 #include <linux/time.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
@@ -190,7 +189,6 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
 {
        vortex_t *chip = snd_pcm_substream_chip(substream);
        stream_t *stream = (stream_t *) (substream->runtime->private_data);
-       struct snd_sg_buf *sgbuf;
        int err;
 
        // Alloc buffer memory.
@@ -200,8 +198,6 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
                printk(KERN_ERR "Vortex: pcm page alloc failed!\n");
                return err;
        }
-       //sgbuf = (struct snd_sg_buf *) substream->runtime->dma_private;
-       sgbuf = snd_pcm_substream_sgbuf(substream);
        /*
           printk(KERN_INFO "Vortex: periods %d, period_bytes %d, channels = %d\n", params_periods(hw_params),
           params_period_bytes(hw_params), params_channels(hw_params));
@@ -227,7 +223,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
                stream = substream->runtime->private_data = &chip->dma_adb[dma];
                stream->substream = substream;
                /* Setup Buffers. */
-               vortex_adbdma_setbuffers(chip, dma, sgbuf,
+               vortex_adbdma_setbuffers(chip, dma,
                                         params_period_bytes(hw_params),
                                         params_periods(hw_params));
        }
@@ -241,7 +237,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
                    &chip->dma_wt[substream->number];
                stream->dma = substream->number;
                stream->substream = substream;
-               vortex_wtdma_setbuffers(chip, substream->number, sgbuf,
+               vortex_wtdma_setbuffers(chip, substream->number,
                                        params_period_bytes(hw_params),
                                        params_periods(hw_params));
        }
@@ -393,13 +389,6 @@ static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substr
        return (bytes_to_frames(substream->runtime, current_ptr));
 }
 
-/* Page callback. */
-/*
-static struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset) {
-       
-       
-}
-*/
 /* operators */
 static struct snd_pcm_ops snd_vortex_playback_ops = {
        .open = snd_vortex_pcm_open,
@@ -499,14 +488,14 @@ static struct snd_kcontrol_new snd_vortex_mixer_spdif[] __devinitdata = {
 };
 
 /* create a pcm device */
-static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr)
+static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
 {
        struct snd_pcm *pcm;
        struct snd_kcontrol *kctl;
        int i;
        int err, nr_capt;
 
-       if ((chip == 0) || (idx < 0) || (idx >= VORTEX_PCM_LAST))
+       if (!chip || idx < 0 || idx >= VORTEX_PCM_LAST)
                return -ENODEV;
 
        /* idx indicates which kind of PCM device. ADB, SPDIF, I2S and A3D share the 
@@ -515,9 +504,9 @@ static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr)
                nr_capt = nr;
        else
                nr_capt = 0;
-       if ((err =
-            snd_pcm_new(chip->card, vortex_pcm_prettyname[idx], idx, nr,
-                        nr_capt, &pcm)) < 0)
+       err = snd_pcm_new(chip->card, vortex_pcm_prettyname[idx], idx, nr,
+                         nr_capt, &pcm);
+       if (err < 0)
                return err;
        strcpy(pcm->name, vortex_pcm_name[idx]);
        chip->pcm[idx] = pcm;