aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/atiixp.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-25 06:54:24 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-26 10:45:12 -0500
commit25135fdcd2b6d3829e3b44560f0b680b7739d988 (patch)
treea32be50dce3ad8771c0b6d9ef2e6d81ec03c13fa /sound/pci/atiixp.c
parentd85d878efb304779205beb951a5d87eb8018b6d8 (diff)
ALSA: atiixp: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/atiixp.c')
-rw-r--r--sound/pci/atiixp.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 85f893b5cc99..ae07b4926dc2 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -432,7 +432,7 @@ static int snd_atiixp_acquire_codec(struct atiixp *chip)
432 432
433 while (atiixp_read(chip, PHYS_OUT_ADDR) & ATI_REG_PHYS_OUT_ADDR_EN) { 433 while (atiixp_read(chip, PHYS_OUT_ADDR) & ATI_REG_PHYS_OUT_ADDR_EN) {
434 if (! timeout--) { 434 if (! timeout--) {
435 snd_printk(KERN_WARNING "atiixp: codec acquire timeout\n"); 435 dev_warn(chip->card->dev, "codec acquire timeout\n");
436 return -EBUSY; 436 return -EBUSY;
437 } 437 }
438 udelay(1); 438 udelay(1);
@@ -463,7 +463,7 @@ static unsigned short snd_atiixp_codec_read(struct atiixp *chip, unsigned short
463 } while (--timeout); 463 } while (--timeout);
464 /* time out may happen during reset */ 464 /* time out may happen during reset */
465 if (reg < 0x7c) 465 if (reg < 0x7c)
466 snd_printk(KERN_WARNING "atiixp: codec read timeout (reg %x)\n", reg); 466 dev_warn(chip->card->dev, "codec read timeout (reg %x)\n", reg);
467 return 0xffff; 467 return 0xffff;
468} 468}
469 469
@@ -523,7 +523,7 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip)
523 mdelay(1); 523 mdelay(1);
524 atiixp_update(chip, CMD, ATI_REG_CMD_AC_RESET, ATI_REG_CMD_AC_RESET); 524 atiixp_update(chip, CMD, ATI_REG_CMD_AC_RESET, ATI_REG_CMD_AC_RESET);
525 if (!--timeout) { 525 if (!--timeout) {
526 snd_printk(KERN_ERR "atiixp: codec reset timeout\n"); 526 dev_err(chip->card->dev, "codec reset timeout\n");
527 break; 527 break;
528 } 528 }
529 } 529 }
@@ -567,9 +567,8 @@ static int ac97_probing_bugs(struct pci_dev *pci)
567 567
568 q = snd_pci_quirk_lookup(pci, atiixp_quirks); 568 q = snd_pci_quirk_lookup(pci, atiixp_quirks);
569 if (q) { 569 if (q) {
570 snd_printdd(KERN_INFO 570 dev_dbg(&pci->dev, "atiixp quirk for %s. Forcing codec %d\n",
571 "Atiixp quirk for %s. Forcing codec %d\n", 571 snd_pci_quirk_name(q), q->value);
572 snd_pci_quirk_name(q), q->value);
573 return q->value; 572 return q->value;
574 } 573 }
575 /* this hardware doesn't need workarounds. Probe for codec */ 574 /* this hardware doesn't need workarounds. Probe for codec */
@@ -600,7 +599,7 @@ static int snd_atiixp_codec_detect(struct atiixp *chip)
600 atiixp_write(chip, IER, 0); /* disable irqs */ 599 atiixp_write(chip, IER, 0); /* disable irqs */
601 600
602 if ((chip->codec_not_ready_bits & ALL_CODEC_NOT_READY) == ALL_CODEC_NOT_READY) { 601 if ((chip->codec_not_ready_bits & ALL_CODEC_NOT_READY) == ALL_CODEC_NOT_READY) {
603 snd_printk(KERN_ERR "atiixp: no codec detected!\n"); 602 dev_err(chip->card->dev, "no codec detected!\n");
604 return -ENXIO; 603 return -ENXIO;
605 } 604 }
606 return 0; 605 return 0;
@@ -676,7 +675,7 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substr
676 continue; 675 continue;
677 return bytes_to_frames(runtime, curptr); 676 return bytes_to_frames(runtime, curptr);
678 } 677 }
679 snd_printd("atiixp: invalid DMA pointer read 0x%x (buf=%x)\n", 678 dev_dbg(chip->card->dev, "invalid DMA pointer read 0x%x (buf=%x)\n",
680 readl(chip->remap_addr + dma->ops->dt_cur), dma->buf_addr); 679 readl(chip->remap_addr + dma->ops->dt_cur), dma->buf_addr);
681 return 0; 680 return 0;
682} 681}
@@ -688,7 +687,7 @@ static void snd_atiixp_xrun_dma(struct atiixp *chip, struct atiixp_dma *dma)
688{ 687{
689 if (! dma->substream || ! dma->running) 688 if (! dma->substream || ! dma->running)
690 return; 689 return;
691 snd_printdd("atiixp: XRUN detected (DMA %d)\n", dma->ops->type); 690 dev_dbg(chip->card->dev, "XRUN detected (DMA %d)\n", dma->ops->type);
692 snd_pcm_stream_lock(dma->substream); 691 snd_pcm_stream_lock(dma->substream);
693 snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN); 692 snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
694 snd_pcm_stream_unlock(dma->substream); 693 snd_pcm_stream_unlock(dma->substream);
@@ -1453,14 +1452,15 @@ static int snd_atiixp_mixer_new(struct atiixp *chip, int clock,
1453 ac97.scaps |= AC97_SCAP_NO_SPDIF; 1452 ac97.scaps |= AC97_SCAP_NO_SPDIF;
1454 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) { 1453 if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) {
1455 chip->ac97[i] = NULL; /* to be sure */ 1454 chip->ac97[i] = NULL; /* to be sure */
1456 snd_printdd("atiixp: codec %d not available for audio\n", i); 1455 dev_dbg(chip->card->dev,
1456 "codec %d not available for audio\n", i);
1457 continue; 1457 continue;
1458 } 1458 }
1459 codec_count++; 1459 codec_count++;
1460 } 1460 }
1461 1461
1462 if (! codec_count) { 1462 if (! codec_count) {
1463 snd_printk(KERN_ERR "atiixp: no codec available\n"); 1463 dev_err(chip->card->dev, "no codec available\n");
1464 return -ENODEV; 1464 return -ENODEV;
1465 } 1465 }
1466 1466
@@ -1511,8 +1511,7 @@ static int snd_atiixp_resume(struct device *dev)
1511 pci_set_power_state(pci, PCI_D0); 1511 pci_set_power_state(pci, PCI_D0);
1512 pci_restore_state(pci); 1512 pci_restore_state(pci);
1513 if (pci_enable_device(pci) < 0) { 1513 if (pci_enable_device(pci) < 0) {
1514 printk(KERN_ERR "atiixp: pci_enable_device failed, " 1514 dev_err(dev, "pci_enable_device failed, disabling device\n");
1515 "disabling device\n");
1516 snd_card_disconnect(card); 1515 snd_card_disconnect(card);
1517 return -EIO; 1516 return -EIO;
1518 } 1517 }
@@ -1637,14 +1636,14 @@ static int snd_atiixp_create(struct snd_card *card,
1637 chip->addr = pci_resource_start(pci, 0); 1636 chip->addr = pci_resource_start(pci, 0);
1638 chip->remap_addr = pci_ioremap_bar(pci, 0); 1637 chip->remap_addr = pci_ioremap_bar(pci, 0);
1639 if (chip->remap_addr == NULL) { 1638 if (chip->remap_addr == NULL) {
1640 snd_printk(KERN_ERR "AC'97 space ioremap problem\n"); 1639 dev_err(card->dev, "AC'97 space ioremap problem\n");
1641 snd_atiixp_free(chip); 1640 snd_atiixp_free(chip);
1642 return -EIO; 1641 return -EIO;
1643 } 1642 }
1644 1643
1645 if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_SHARED, 1644 if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_SHARED,
1646 KBUILD_MODNAME, chip)) { 1645 KBUILD_MODNAME, chip)) {
1647 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 1646 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
1648 snd_atiixp_free(chip); 1647 snd_atiixp_free(chip);
1649 return -EBUSY; 1648 return -EBUSY;
1650 } 1649 }