]> err.no Git - linux-2.6/blobdiff - sound/oss/trident.c
[ALSA] Use posix clock monotonic for PCM and timer timestamps
[linux-2.6] / sound / oss / trident.c
index 3e408f49192792ba35c123e164d374cc31f0fa13..96adc47917aa538b57c60ac67ef7f11fe6deb881 100644 (file)
@@ -2702,6 +2702,7 @@ trident_open(struct inode *inode, struct file *file)
        struct trident_card *card = devs;
        struct trident_state *state = NULL;
        struct dmabuf *dmabuf = NULL;
+       unsigned long flags;
 
        /* Added by Matt Wu 01-05-2001 */
        /* TODO: there's some redundacy here wrt the check below */
@@ -2779,7 +2780,9 @@ trident_open(struct inode *inode, struct file *file)
                        /* set default channel attribute to normal playback */
                        dmabuf->channel->attribute = CHANNEL_PB;
                }
+               spin_lock_irqsave(&card->lock, flags);
                trident_set_dac_rate(state, 8000);
+               spin_unlock_irqrestore(&card->lock, flags);
        }
 
        if (file->f_mode & FMODE_READ) {
@@ -2797,7 +2800,9 @@ trident_open(struct inode *inode, struct file *file)
                        dmabuf->channel->attribute = (CHANNEL_REC | PCM_LR |
                                                      MONO_MIX);
                }
+               spin_lock_irqsave(&card->lock, flags);
                trident_set_adc_rate(state, 8000);
+               spin_unlock_irqrestore(&card->lock, flags);
 
                /* Added by Matt Wu 01-05-2001 */
                if (card->pci_id == PCI_DEVICE_ID_ALI_5451)
@@ -4449,9 +4454,9 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
 
                /* Add H/W Volume Control By Matt Wu Jul. 06, 2001 */
                card->hwvolctl = 0;
-               pci_dev_m1533 = pci_find_device(PCI_VENDOR_ID_AL,
-                                               PCI_DEVICE_ID_AL_M1533,
-                                               pci_dev_m1533);
+               pci_dev_m1533 = pci_get_device(PCI_VENDOR_ID_AL,
+                                              PCI_DEVICE_ID_AL_M1533,
+                                              pci_dev_m1533);
                rc = -ENODEV;
                if (pci_dev_m1533 == NULL)
                        goto out_proc_fs;
@@ -4465,6 +4470,8 @@ trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
                        bits &= 0xbf;   /*clear bit 6 */
                        pci_write_config_byte(pci_dev_m1533, 0x7b, bits);
                }
+               pci_dev_put(pci_dev_m1533);
+
        } else if (card->pci_id == PCI_DEVICE_ID_INTERG_5050) {
                card->alloc_pcm_channel = cyber_alloc_pcm_channel;
                card->alloc_rec_pcm_channel = cyber_alloc_pcm_channel;