aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/au88x0/au88x0.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/au88x0/au88x0.c')
-rw-r--r--sound/pci/au88x0/au88x0.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index 7d9184f7367..126870ec063 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -151,14 +151,18 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
// check PCI availability (DMA).
if ((err = pci_enable_device(pci)) < 0)
return err;
- if (pci_set_dma_mask(pci, DMA_32BIT_MASK)) {
+ if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 ||
+ pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) < 0) {
printk(KERN_ERR "error to set DMA mask\n");
+ pci_disable_device(pci);
return -ENXIO;
}
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (chip == NULL)
+ if (chip == NULL) {
+ pci_disable_device(pci);
return -ENOMEM;
+ }
chip->card = card;
@@ -208,6 +212,8 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
goto alloc_out;
}
+ snd_card_set_dev(card, &pci->dev);
+
*rchip = chip;
return 0;