#define DEVNAME "ad1889"
#define PFX DEVNAME ": "
-/* let's use the global sound debug interfaces */
-#define ad1889_debug(fmt, arg...) snd_printd(KERN_DEBUG fmt, ## arg)
-
/* keep track of some hw registers */
struct ad1889_register_state {
u16 reg; /* reg setup */
&& --retry)
mdelay(1);
if (!retry) {
- snd_printk(KERN_ERR PFX "[%s] Link is not ready.\n",
- __func__);
+ dev_err(chip->card->dev, "[%s] Link is not ready.\n",
+ __func__);
return -EIO;
}
- ad1889_debug("[%s] ready after %d ms\n", __func__, 400 - retry);
+ dev_dbg(chip->card->dev, "[%s] ready after %d ms\n", __func__, 400 - retry);
return 0;
}
spin_unlock_irq(&chip->lock);
- ad1889_debug("prepare playback: addr = 0x%x, count = %u, "
- "size = %u, reg = 0x%x, rate = %u\n", chip->wave.addr,
- count, size, reg, rt->rate);
+ dev_dbg(chip->card->dev,
+ "prepare playback: addr = 0x%x, count = %u, size = %u, reg = 0x%x, rate = %u\n",
+ chip->wave.addr, count, size, reg, rt->rate);
return 0;
}
spin_unlock_irq(&chip->lock);
- ad1889_debug("prepare capture: addr = 0x%x, count = %u, "
- "size = %u, reg = 0x%x, rate = %u\n", chip->ramc.addr,
- count, size, reg, rt->rate);
+ dev_dbg(chip->card->dev,
+ "prepare capture: addr = 0x%x, count = %u, size = %u, reg = 0x%x, rate = %u\n",
+ chip->ramc.addr, count, size, reg, rt->rate);
return 0;
}
return IRQ_NONE;
if (st & (AD_DMA_DISR_PMAI|AD_DMA_DISR_PTAI))
- ad1889_debug("Unexpected master or target abort interrupt!\n");
+ dev_dbg(chip->card->dev,
+ "Unexpected master or target abort interrupt!\n");
if ((st & AD_DMA_DISR_WAVI) && chip->psubs)
snd_pcm_period_elapsed(chip->psubs);
BUFFER_BYTES_MAX);
if (err < 0) {
- snd_printk(KERN_ERR PFX "buffer allocation error: %d\n", err);
+ dev_err(chip->card->dev, "buffer allocation error: %d\n", err);
return err;
}
/* check PCI availability (32bit DMA) */
if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 ||
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) {
- printk(KERN_ERR PFX "error setting 32-bit DMA mask.\n");
+ dev_err(card->dev, "error setting 32-bit DMA mask.\n");
pci_disable_device(pci);
return -ENXIO;
}
chip->bar = pci_resource_start(pci, 0);
chip->iobase = pci_ioremap_bar(pci, 0);
if (chip->iobase == NULL) {
- printk(KERN_ERR PFX "unable to reserve region.\n");
+ dev_err(card->dev, "unable to reserve region.\n");
err = -EBUSY;
goto free_and_ret;
}
if (request_irq(pci->irq, snd_ad1889_interrupt,
IRQF_SHARED, KBUILD_MODNAME, chip)) {
- printk(KERN_ERR PFX "cannot obtain IRQ %d\n", pci->irq);
+ dev_err(card->dev, "cannot obtain IRQ %d\n", pci->irq);
snd_ad1889_free(chip);
return -EBUSY;
}