Commit ca6aafd8 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: atiixp-modem: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 25135fdc
...@@ -400,7 +400,7 @@ static int snd_atiixp_acquire_codec(struct atiixp_modem *chip) ...@@ -400,7 +400,7 @@ static int snd_atiixp_acquire_codec(struct atiixp_modem *chip)
while (atiixp_read(chip, PHYS_OUT_ADDR) & ATI_REG_PHYS_OUT_ADDR_EN) { while (atiixp_read(chip, PHYS_OUT_ADDR) & ATI_REG_PHYS_OUT_ADDR_EN) {
if (! timeout--) { if (! timeout--) {
snd_printk(KERN_WARNING "atiixp-modem: codec acquire timeout\n"); dev_warn(chip->card->dev, "codec acquire timeout\n");
return -EBUSY; return -EBUSY;
} }
udelay(1); udelay(1);
...@@ -433,7 +433,7 @@ static unsigned short snd_atiixp_codec_read(struct atiixp_modem *chip, ...@@ -433,7 +433,7 @@ static unsigned short snd_atiixp_codec_read(struct atiixp_modem *chip,
} while (--timeout); } while (--timeout);
/* time out may happen during reset */ /* time out may happen during reset */
if (reg < 0x7c) if (reg < 0x7c)
snd_printk(KERN_WARNING "atiixp-modem: codec read timeout (reg %x)\n", reg); dev_warn(chip->card->dev, "codec read timeout (reg %x)\n", reg);
return 0xffff; return 0xffff;
} }
...@@ -499,7 +499,7 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip) ...@@ -499,7 +499,7 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip)
msleep(1); msleep(1);
atiixp_update(chip, CMD, ATI_REG_CMD_AC_RESET, ATI_REG_CMD_AC_RESET); atiixp_update(chip, CMD, ATI_REG_CMD_AC_RESET, ATI_REG_CMD_AC_RESET);
if (!--timeout) { if (!--timeout) {
snd_printk(KERN_ERR "atiixp-modem: codec reset timeout\n"); dev_err(chip->card->dev, "codec reset timeout\n");
break; break;
} }
} }
...@@ -553,7 +553,7 @@ static int snd_atiixp_codec_detect(struct atiixp_modem *chip) ...@@ -553,7 +553,7 @@ static int snd_atiixp_codec_detect(struct atiixp_modem *chip)
atiixp_write(chip, IER, 0); /* disable irqs */ atiixp_write(chip, IER, 0); /* disable irqs */
if ((chip->codec_not_ready_bits & ALL_CODEC_NOT_READY) == ALL_CODEC_NOT_READY) { if ((chip->codec_not_ready_bits & ALL_CODEC_NOT_READY) == ALL_CODEC_NOT_READY) {
snd_printk(KERN_ERR "atiixp-modem: no codec detected!\n"); dev_err(chip->card->dev, "no codec detected!\n");
return -ENXIO; return -ENXIO;
} }
return 0; return 0;
...@@ -624,7 +624,7 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substr ...@@ -624,7 +624,7 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substr
continue; continue;
return bytes_to_frames(runtime, curptr); return bytes_to_frames(runtime, curptr);
} }
snd_printd("atiixp-modem: invalid DMA pointer read 0x%x (buf=%x)\n", dev_dbg(chip->card->dev, "invalid DMA pointer read 0x%x (buf=%x)\n",
readl(chip->remap_addr + dma->ops->dt_cur), dma->buf_addr); readl(chip->remap_addr + dma->ops->dt_cur), dma->buf_addr);
return 0; return 0;
} }
...@@ -637,7 +637,7 @@ static void snd_atiixp_xrun_dma(struct atiixp_modem *chip, ...@@ -637,7 +637,7 @@ static void snd_atiixp_xrun_dma(struct atiixp_modem *chip,
{ {
if (! dma->substream || ! dma->running) if (! dma->substream || ! dma->running)
return; return;
snd_printdd("atiixp-modem: XRUN detected (DMA %d)\n", dma->ops->type); dev_dbg(chip->card->dev, "XRUN detected (DMA %d)\n", dma->ops->type);
snd_pcm_stream_lock(dma->substream); snd_pcm_stream_lock(dma->substream);
snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN); snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
snd_pcm_stream_unlock(dma->substream); snd_pcm_stream_unlock(dma->substream);
...@@ -1098,14 +1098,15 @@ static int snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock) ...@@ -1098,14 +1098,15 @@ static int snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock)
ac97.scaps = AC97_SCAP_SKIP_AUDIO | AC97_SCAP_POWER_SAVE; ac97.scaps = AC97_SCAP_SKIP_AUDIO | AC97_SCAP_POWER_SAVE;
if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) { if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) {
chip->ac97[i] = NULL; /* to be sure */ chip->ac97[i] = NULL; /* to be sure */
snd_printdd("atiixp-modem: codec %d not available for modem\n", i); dev_dbg(chip->card->dev,
"codec %d not available for modem\n", i);
continue; continue;
} }
codec_count++; codec_count++;
} }
if (! codec_count) { if (! codec_count) {
snd_printk(KERN_ERR "atiixp-modem: no codec available\n"); dev_err(chip->card->dev, "no codec available\n");
return -ENODEV; return -ENODEV;
} }
...@@ -1150,8 +1151,7 @@ static int snd_atiixp_resume(struct device *dev) ...@@ -1150,8 +1151,7 @@ static int snd_atiixp_resume(struct device *dev)
pci_set_power_state(pci, PCI_D0); pci_set_power_state(pci, PCI_D0);
pci_restore_state(pci); pci_restore_state(pci);
if (pci_enable_device(pci) < 0) { if (pci_enable_device(pci) < 0) {
printk(KERN_ERR "atiixp-modem: pci_enable_device failed, " dev_err(dev, "pci_enable_device failed, disabling device\n");
"disabling device\n");
snd_card_disconnect(card); snd_card_disconnect(card);
return -EIO; return -EIO;
} }
...@@ -1262,14 +1262,14 @@ static int snd_atiixp_create(struct snd_card *card, ...@@ -1262,14 +1262,14 @@ static int snd_atiixp_create(struct snd_card *card,
chip->addr = pci_resource_start(pci, 0); chip->addr = pci_resource_start(pci, 0);
chip->remap_addr = pci_ioremap_bar(pci, 0); chip->remap_addr = pci_ioremap_bar(pci, 0);
if (chip->remap_addr == NULL) { if (chip->remap_addr == NULL) {
snd_printk(KERN_ERR "AC'97 space ioremap problem\n"); dev_err(card->dev, "AC'97 space ioremap problem\n");
snd_atiixp_free(chip); snd_atiixp_free(chip);
return -EIO; return -EIO;
} }
if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_SHARED, if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_SHARED,
KBUILD_MODNAME, chip)) { KBUILD_MODNAME, chip)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
snd_atiixp_free(chip); snd_atiixp_free(chip);
return -EBUSY; return -EBUSY;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment