offset -= chip->buffer_start;
#ifdef CONFIG_SND_DEBUG
if (offset < 0 || offset >= chip->buffer_size) {
- snd_printk(KERN_ERR "write_buffer invalid offset = %d size = %d\n",
+ dev_err(chip->card->dev,
+ "write_buffer invalid offset = %d size = %d\n",
offset, size);
return;
}
NM_RECORD_REG_OFFSET : NM_PLAYBACK_REG_OFFSET);
if (snd_nm256_readb(chip, poffset) & 1) {
- snd_printd("NM256: Engine was enabled while loading coefficients!\n");
+ dev_dbg(chip->card->dev,
+ "NM256: Engine was enabled while loading coefficients!\n");
return;
}
if (chip->irq < 0) {
if (request_irq(chip->pci->irq, chip->interrupt, IRQF_SHARED,
KBUILD_MODNAME, chip)) {
- snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->pci->irq);
+ dev_err(chip->card->dev,
+ "unable to grab IRQ %d\n", chip->pci->irq);
mutex_unlock(&chip->irq_mutex);
return -EBUSY;
}
if (status & NM_MISC_INT_1) {
status &= ~NM_MISC_INT_1;
NM_ACK_INT(chip, NM_MISC_INT_1);
- snd_printd("NM256: Got misc interrupt #1\n");
+ dev_dbg(chip->card->dev, "NM256: Got misc interrupt #1\n");
snd_nm256_writew(chip, NM_INT_REG, 0x8000);
cbyte = snd_nm256_readb(chip, 0x400);
snd_nm256_writeb(chip, 0x400, cbyte | 2);
if (status & NM_MISC_INT_2) {
status &= ~NM_MISC_INT_2;
NM_ACK_INT(chip, NM_MISC_INT_2);
- snd_printd("NM256: Got misc interrupt #2\n");
+ dev_dbg(chip->card->dev, "NM256: Got misc interrupt #2\n");
cbyte = snd_nm256_readb(chip, 0x400);
snd_nm256_writeb(chip, 0x400, cbyte & ~2);
}
/* Unknown interrupt. */
if (status) {
- snd_printd("NM256: Fire in the hole! Unknown status 0x%x\n",
+ dev_dbg(chip->card->dev,
+ "NM256: Fire in the hole! Unknown status 0x%x\n",
status);
/* Pray. */
NM_ACK_INT(chip, status);
if (status & NM2_MISC_INT_1) {
status &= ~NM2_MISC_INT_1;
NM2_ACK_INT(chip, NM2_MISC_INT_1);
- snd_printd("NM256: Got misc interrupt #1\n");
+ dev_dbg(chip->card->dev, "NM256: Got misc interrupt #1\n");
cbyte = snd_nm256_readb(chip, 0x400);
snd_nm256_writeb(chip, 0x400, cbyte | 2);
}
if (status & NM2_MISC_INT_2) {
status &= ~NM2_MISC_INT_2;
NM2_ACK_INT(chip, NM2_MISC_INT_2);
- snd_printd("NM256: Got misc interrupt #2\n");
+ dev_dbg(chip->card->dev, "NM256: Got misc interrupt #2\n");
cbyte = snd_nm256_readb(chip, 0x400);
snd_nm256_writeb(chip, 0x400, cbyte & ~2);
}
/* Unknown interrupt. */
if (status) {
- snd_printd("NM256: Fire in the hole! Unknown status 0x%x\n",
+ dev_dbg(chip->card->dev,
+ "NM256: Fire in the hole! Unknown status 0x%x\n",
status);
/* Pray. */
NM2_ACK_INT(chip, status);
return;
}
}
- snd_printd("nm256: ac97 codec not ready..\n");
+ dev_dbg(chip->card->dev, "nm256: ac97 codec not ready..\n");
}
/* static resolution table */
temp = ioremap_nocache(chip->buffer_addr + chip->buffer_end - 0x400, 16);
if (temp == NULL) {
- snd_printk(KERN_ERR "Unable to scan for card signature in video RAM\n");
+ dev_err(chip->card->dev,
+ "Unable to scan for card signature in video RAM\n");
return -EBUSY;
}
if (pointer == 0xffffffff ||
pointer < chip->buffer_size ||
pointer > chip->buffer_end) {
- snd_printk(KERN_ERR "invalid signature found: 0x%x\n", pointer);
+ dev_err(chip->card->dev,
+ "invalid signature found: 0x%x\n", pointer);
iounmap(temp);
return -ENODEV;
} else {
pointer_found = pointer;
- printk(KERN_INFO "nm256: found card signature in video RAM: 0x%x\n",
+ dev_info(chip->card->dev,
+ "found card signature in video RAM: 0x%x\n",
pointer);
}
}
pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci);
if (pci_enable_device(pci) < 0) {
- printk(KERN_ERR "nm256: pci_enable_device failed, "
- "disabling device\n");
+ dev_err(dev, "pci_enable_device failed, disabling device\n");
snd_card_disconnect(card);
return -EIO;
}
chip->res_cport = request_mem_region(chip->cport_addr, NM_PORT2_SIZE,
card->driver);
if (chip->res_cport == NULL) {
- snd_printk(KERN_ERR "memory region 0x%lx (size 0x%x) busy\n",
+ dev_err(card->dev, "memory region 0x%lx (size 0x%x) busy\n",
chip->cport_addr, NM_PORT2_SIZE);
err = -EBUSY;
goto __error;
}
chip->cport = ioremap_nocache(chip->cport_addr, NM_PORT2_SIZE);
if (chip->cport == NULL) {
- snd_printk(KERN_ERR "unable to map control port %lx\n", chip->cport_addr);
+ dev_err(card->dev, "unable to map control port %lx\n",
+ chip->cport_addr);
err = -ENOMEM;
goto __error;
}
pval = snd_nm256_readw(chip, NM_MIXER_PRESENCE);
if ((pval & NM_PRESENCE_MASK) != NM_PRESENCE_VALUE) {
if (! force_ac97) {
- printk(KERN_ERR "nm256: no ac97 is found!\n");
- printk(KERN_ERR " force the driver to load by "
- "passing in the module parameter\n");
- printk(KERN_ERR " force_ac97=1\n");
- printk(KERN_ERR " or try sb16, opl3sa2, or "
- "cs423x drivers instead.\n");
+ dev_err(card->dev,
+ "no ac97 is found!\n");
+ dev_err(card->dev,
+ "force the driver to load by passing in the module parameter\n");
+ dev_err(card->dev,
+ " force_ac97=1\n");
+ dev_err(card->dev,
+ "or try sb16, opl3sa2, or cs423x drivers instead.\n");
err = -ENXIO;
goto __error;
}
chip->buffer_start = chip->buffer_end - chip->buffer_size;
chip->buffer_addr += chip->buffer_start;
- printk(KERN_INFO "nm256: Mapping port 1 from 0x%x - 0x%x\n",
+ dev_info(card->dev, "Mapping port 1 from 0x%x - 0x%x\n",
chip->buffer_start, chip->buffer_end);
chip->res_buffer = request_mem_region(chip->buffer_addr,
chip->buffer_size,
card->driver);
if (chip->res_buffer == NULL) {
- snd_printk(KERN_ERR "nm256: buffer 0x%lx (size 0x%x) busy\n",
+ dev_err(card->dev, "buffer 0x%lx (size 0x%x) busy\n",
chip->buffer_addr, chip->buffer_size);
err = -EBUSY;
goto __error;
chip->buffer = ioremap_nocache(chip->buffer_addr, chip->buffer_size);
if (chip->buffer == NULL) {
err = -ENOMEM;
- snd_printk(KERN_ERR "unable to map ring buffer at %lx\n", chip->buffer_addr);
+ dev_err(card->dev, "unable to map ring buffer at %lx\n",
+ chip->buffer_addr);
goto __error;
}
q = snd_pci_quirk_lookup(pci, nm256_quirks);
if (q) {
- snd_printdd(KERN_INFO "nm256: Enabled quirk for %s.\n",
+ dev_dbg(&pci->dev, "Enabled quirk for %s.\n",
snd_pci_quirk_name(q));
switch (q->value) {
case NM_BLACKLISTED:
- printk(KERN_INFO "nm256: The device is blacklisted. "
- "Loading stopped\n");
+ dev_info(&pci->dev,
+ "The device is blacklisted. Loading stopped\n");
return -ENODEV;
case NM_RESET_WORKAROUND_2:
reset_workaround_2 = 1;
strcpy(card->driver, "NM256XL+");
break;
default:
- snd_printk(KERN_ERR "invalid device id 0x%x\n", pci->device);
+ dev_err(&pci->dev, "invalid device id 0x%x\n", pci->device);
snd_card_free(card);
return -EINVAL;
}
card->private_data = chip;
if (reset_workaround) {
- snd_printdd(KERN_INFO "nm256: reset_workaround activated\n");
+ dev_dbg(&pci->dev, "reset_workaround activated\n");
chip->reset_workaround = 1;
}
if (reset_workaround_2) {
- snd_printdd(KERN_INFO "nm256: reset_workaround_2 activated\n");
+ dev_dbg(&pci->dev, "reset_workaround_2 activated\n");
chip->reset_workaround_2 = 1;
}