tree-wide: fix comment/printk typos
[linux-flexiantxendom0-natty.git] / sound / pci / rme9652 / hdspm.c
index d7dd536..f5eadfc 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/moduleparam.h>
 #include <linux/slab.h>
 #include <linux/pci.h>
+#include <linux/math64.h>
 #include <asm/io.h>
 
 #include <sound/core.h>
@@ -486,7 +487,7 @@ struct hdspm {
        struct snd_kcontrol *playback_mixer_ctls[HDSPM_MAX_CHANNELS];
        /* but input to much, so not used */
        struct snd_kcontrol *input_mixer_ctls[HDSPM_MAX_CHANNELS];
-       /* full mixer accessable over mixer ioctl or hwdep-device */
+       /* full mixer accessible over mixer ioctl or hwdep-device */
        struct hdspm_mixer *mixer;
 
 };
@@ -511,7 +512,7 @@ static char channel_map_madi_ss[HDSPM_MAX_CHANNELS] = {
 };
 
 
-static struct pci_device_id snd_hdspm_ids[] __devinitdata = {
+static DEFINE_PCI_DEVICE_TABLE(snd_hdspm_ids) = {
        {
         .vendor = PCI_VENDOR_ID_XILINX,
         .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI,
@@ -549,7 +550,7 @@ static inline int HDSPM_bit2freq(int n)
        return bit2freq_tab[n];
 }
 
-/* Write/read to/from HDSPM with Adresses in Bytes
+/* Write/read to/from HDSPM with Addresses in Bytes
    not words but only 32Bit writes are allowed */
 
 static inline void hdspm_write(struct hdspm * hdspm, unsigned int reg,
@@ -831,7 +832,6 @@ static int hdspm_set_interrupt_interval(struct hdspm * s, unsigned int frames)
 static void hdspm_set_dds_value(struct hdspm *hdspm, int rate)
 {
        u64 n;
-       u32 r;
        
        if (rate >= 112000)
                rate /= 4;
@@ -844,7 +844,7 @@ static void hdspm_set_dds_value(struct hdspm *hdspm, int rate)
         */        
        /* n = 104857600000000ULL; */ /*  =  2^20 * 10^8 */
        n = 110100480000000ULL;    /* Value checked for AES32 and MADI */
-       div64_32(&n, rate, &r);
+       n = div_u64(n, rate);
        /* n should be less than 2^32 for being written to FREQ register */
        snd_BUG_ON(n >> 32);
        hdspm_write(hdspm, HDSPM_freqReg, (u32)n);
@@ -1293,7 +1293,7 @@ static int __devinit snd_hdspm_create_midi (struct snd_card *card,
        if (err < 0)
                return err;
 
-       sprintf (hdspm->midi[id].rmidi->name, "%s MIDI %d", card->id, id+1);
+       sprintf(hdspm->midi[id].rmidi->name, "HDSPM MIDI %d", id+1);
        hdspm->midi[id].rmidi->private_data = &hdspm->midi[id];
 
        snd_rawmidi_set_ops(hdspm->midi[id].rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
@@ -2479,7 +2479,7 @@ static int snd_hdspm_put_qs_wire(struct snd_kcontrol *kcontrol,
    on MADICARD 
   - playback mixer matrix: [channelout+64] [output] [value]
   - input(thru) mixer matrix: [channelin] [output] [value]
-  (better do 2 kontrols for seperation ?)
+  (better do 2 kontrols for separation ?)
 */
 
 #define HDSPM_MIXER(xname, xindex) \
@@ -2908,7 +2908,7 @@ static int snd_hdspm_create_controls(struct snd_card *card, struct hdspm * hdspm
 
        /* Channel playback mixer as default control 
           Note: the whole matrix would be 128*HDSPM_MIXER_CHANNELS Faders,
-          thats too * big for any alsamixer they are accesible via special
+          thats too * big for any alsamixer they are accessible via special
           IOCTL on hwdep and the mixer 2dimensional mixer control
        */
 
@@ -3017,7 +3017,7 @@ snd_hdspm_proc_read_madi(struct snd_info_entry * entry,
                insel = "Coaxial";
                break;
        default:
-               insel = "Unkown";
+               insel = "Unknown";
        }
 
        switch (hdspm->control_register & HDSPM_SyncRefMask) {
@@ -3028,7 +3028,7 @@ snd_hdspm_proc_read_madi(struct snd_info_entry * entry,
                syncref = "MADI";
                break;
        default:
-               syncref = "Unkown";
+               syncref = "Unknown";
        }
        snd_iprintf(buffer, "Inputsel = %s, SyncRef = %s\n", insel,
                    syncref);
@@ -4100,13 +4100,6 @@ static int snd_hdspm_capture_release(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static int snd_hdspm_hwdep_dummy_op(struct snd_hwdep * hw, struct file *file)
-{
-       /* we have nothing to initialize but the call is required */
-       return 0;
-}
-
-
 static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
                                 unsigned int cmd, unsigned long arg)
 {
@@ -4134,6 +4127,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
 
        case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO:
 
+               memset(&info, 0, sizeof(info));
                spin_lock_irq(&hdspm->lock);
                info.pref_sync_ref = hdspm_pref_sync_ref(hdspm);
                info.wordclock_sync_check = hdspm_wc_sync_check(hdspm);
@@ -4213,9 +4207,7 @@ static int __devinit snd_hdspm_create_hwdep(struct snd_card *card,
        hw->private_data = hdspm;
        strcpy(hw->name, "HDSPM hwdep interface");
 
-       hw->ops.open = snd_hdspm_hwdep_dummy_op;
        hw->ops.ioctl = snd_hdspm_hwdep_ioctl;
-       hw->ops.release = snd_hdspm_hwdep_dummy_op;
 
        return 0;
 }
@@ -4503,10 +4495,10 @@ static int __devinit snd_hdspm_probe(struct pci_dev *pci,
                return -ENOENT;
        }
 
-       card = snd_card_new(index[dev], id[dev],
-                           THIS_MODULE, sizeof(struct hdspm));
-       if (!card)
-               return -ENOMEM;
+       err = snd_card_create(index[dev], id[dev],
+                             THIS_MODULE, sizeof(struct hdspm), &card);
+       if (err < 0)
+               return err;
 
        hdspm = card->private_data;
        card->private_free = snd_hdspm_card_free;