diff options
Diffstat (limited to 'sound/pci/echoaudio/echoaudio.c')
-rw-r--r-- | sound/pci/echoaudio/echoaudio.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 05cfe551ce42..9f10c9e0df5e 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -58,7 +58,8 @@ static int get_firmware(const struct firmware **fw_entry, snprintf(name, sizeof(name), "ea/%s", card_fw[fw_index].data); err = request_firmware(fw_entry, name, pci_device(chip)); if (err < 0) - snd_printk(KERN_ERR "get_firmware(): Firmware not available (%d)\n", err); + dev_err(chip->card->dev, + "get_firmware(): Firmware not available (%d)\n", err); #ifdef CONFIG_PM_SLEEP else chip->fw_cache[fw_index] = *fw_entry; @@ -563,7 +564,7 @@ static int init_engine(struct snd_pcm_substream *substream, err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); if (err < 0) { - snd_printk(KERN_ERR "malloc_pages err=%d\n", err); + dev_err(chip->card->dev, "malloc_pages err=%d\n", err); spin_lock_irq(&chip->lock); free_pipes(chip, pipe); spin_unlock_irq(&chip->lock); @@ -1989,8 +1990,8 @@ static int snd_echo_create(struct snd_card *card, if ((chip->iores = request_mem_region(chip->dsp_registers_phys, sz, ECHOCARD_NAME)) == NULL) { + dev_err(chip->card->dev, "cannot get memory region\n"); snd_echo_free(chip); - snd_printk(KERN_ERR "cannot get memory region\n"); return -EBUSY; } chip->dsp_registers = (volatile u32 __iomem *) @@ -1998,8 +1999,8 @@ static int snd_echo_create(struct snd_card *card, if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED, KBUILD_MODNAME, chip)) { + dev_err(chip->card->dev, "cannot grab irq\n"); snd_echo_free(chip); - snd_printk(KERN_ERR "cannot grab irq\n"); return -EBUSY; } chip->irq = pci->irq; @@ -2011,8 +2012,8 @@ static int snd_echo_create(struct snd_card *card, if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), sizeof(struct comm_page), &chip->commpage_dma_buf) < 0) { + dev_err(chip->card->dev, "cannot allocate the comm page\n"); snd_echo_free(chip); - snd_printk(KERN_ERR "cannot allocate the comm page\n"); return -ENOMEM; } chip->comm_page_phys = chip->commpage_dma_buf.addr; @@ -2058,12 +2059,11 @@ static int snd_echo_probe(struct pci_dev *pci, DE_INIT(("Echoaudio driver starting...\n")); i = 0; - err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); + err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, + 0, &card); if (err < 0) return err; - snd_card_set_dev(card, &pci->dev); - chip = NULL; /* Tells snd_echo_create to allocate chip */ if ((err = snd_echo_create(card, pci, &chip)) < 0) { snd_card_free(card); @@ -2082,7 +2082,7 @@ static int snd_echo_probe(struct pci_dev *pci, chip->dsp_registers_phys, chip->irq); if ((err = snd_echo_new_pcm(chip)) < 0) { - snd_printk(KERN_ERR "new pcm error %d\n", err); + dev_err(chip->card->dev, "new pcm error %d\n", err); snd_card_free(card); return err; } @@ -2090,7 +2090,7 @@ static int snd_echo_probe(struct pci_dev *pci, #ifdef ECHOCARD_HAS_MIDI if (chip->has_midi) { /* Some Mia's do not have midi */ if ((err = snd_echo_midi_create(card, chip)) < 0) { - snd_printk(KERN_ERR "new midi error %d\n", err); + dev_err(chip->card->dev, "new midi error %d\n", err); snd_card_free(card); return err; } @@ -2189,14 +2189,14 @@ static int snd_echo_probe(struct pci_dev *pci, err = snd_card_register(card); if (err < 0) goto ctl_error; - snd_printk(KERN_INFO "Card registered: %s\n", card->longname); + dev_info(card->dev, "Card registered: %s\n", card->longname); pci_set_drvdata(pci, chip); dev++; return 0; ctl_error: - snd_printk(KERN_ERR "new control error %d\n", err); + dev_err(card->dev, "new control error %d\n", err); snd_card_free(card); return err; } @@ -2291,8 +2291,8 @@ static int snd_echo_resume(struct device *dev) if (request_irq(pci->irq, snd_echo_interrupt, IRQF_SHARED, KBUILD_MODNAME, chip)) { + dev_err(chip->card->dev, "cannot grab irq\n"); snd_echo_free(chip); - snd_printk(KERN_ERR "cannot grab irq\n"); return -EBUSY; } chip->irq = pci->irq; |