aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-25 08:29:55 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-26 10:45:17 -0500
commit86cd372fe5c5611ffa310720c873e1d210175b5b (patch)
tree66032c835241994f785905b6ff4603df12695e52 /sound/pci
parentebebecaa0a9a26a246f1c20ee2f9d90da37f70f8 (diff)
ALSA: es1968: 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')
-rw-r--r--sound/pci/es1968.c49
1 files changed, 27 insertions, 22 deletions
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 87e9cd5d3ceb..5bb1cf603301 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -632,7 +632,7 @@ static int snd_es1968_ac97_wait(struct es1968 *chip)
632 return 0; 632 return 0;
633 cond_resched(); 633 cond_resched();
634 } 634 }
635 snd_printd("es1968: ac97 timeout\n"); 635 dev_dbg(chip->card->dev, "ac97 timeout\n");
636 return 1; /* timeout */ 636 return 1; /* timeout */
637} 637}
638 638
@@ -644,7 +644,7 @@ static int snd_es1968_ac97_wait_poll(struct es1968 *chip)
644 if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1)) 644 if (!(inb(chip->io_port + ESM_AC97_INDEX) & 1))
645 return 0; 645 return 0;
646 } 646 }
647 snd_printd("es1968: ac97 timeout\n"); 647 dev_dbg(chip->card->dev, "ac97 timeout\n");
648 return 1; /* timeout */ 648 return 1; /* timeout */
649} 649}
650 650
@@ -687,7 +687,7 @@ static void apu_index_set(struct es1968 *chip, u16 index)
687 for (i = 0; i < 1000; i++) 687 for (i = 0; i < 1000; i++)
688 if (__maestro_read(chip, IDR1_CRAM_POINTER) == index) 688 if (__maestro_read(chip, IDR1_CRAM_POINTER) == index)
689 return; 689 return;
690 snd_printd("es1968: APU register select failed. (Timeout)\n"); 690 dev_dbg(chip->card->dev, "APU register select failed. (Timeout)\n");
691} 691}
692 692
693/* no spinlock */ 693/* no spinlock */
@@ -699,7 +699,7 @@ static void apu_data_set(struct es1968 *chip, u16 data)
699 return; 699 return;
700 __maestro_write(chip, IDR0_DATA_PORT, data); 700 __maestro_write(chip, IDR0_DATA_PORT, data);
701 } 701 }
702 snd_printd("es1968: APU register set probably failed (Timeout)!\n"); 702 dev_dbg(chip->card->dev, "APU register set probably failed (Timeout)!\n");
703} 703}
704 704
705/* no spinlock */ 705/* no spinlock */
@@ -1442,13 +1442,14 @@ snd_es1968_init_dmabuf(struct es1968 *chip)
1442 snd_dma_pci_data(chip->pci), 1442 snd_dma_pci_data(chip->pci),
1443 chip->total_bufsize, &chip->dma); 1443 chip->total_bufsize, &chip->dma);
1444 if (err < 0 || ! chip->dma.area) { 1444 if (err < 0 || ! chip->dma.area) {
1445 snd_printk(KERN_ERR "es1968: can't allocate dma pages for size %d\n", 1445 dev_err(chip->card->dev,
1446 "can't allocate dma pages for size %d\n",
1446 chip->total_bufsize); 1447 chip->total_bufsize);
1447 return -ENOMEM; 1448 return -ENOMEM;
1448 } 1449 }
1449 if ((chip->dma.addr + chip->dma.bytes - 1) & ~((1 << 28) - 1)) { 1450 if ((chip->dma.addr + chip->dma.bytes - 1) & ~((1 << 28) - 1)) {
1450 snd_dma_free_pages(&chip->dma); 1451 snd_dma_free_pages(&chip->dma);
1451 snd_printk(KERN_ERR "es1968: DMA buffer beyond 256MB.\n"); 1452 dev_err(chip->card->dev, "DMA buffer beyond 256MB.\n");
1452 return -ENOMEM; 1453 return -ENOMEM;
1453 } 1454 }
1454 1455
@@ -1489,7 +1490,8 @@ static int snd_es1968_hw_params(struct snd_pcm_substream *substream,
1489 } 1490 }
1490 chan->memory = snd_es1968_new_memory(chip, size); 1491 chan->memory = snd_es1968_new_memory(chip, size);
1491 if (chan->memory == NULL) { 1492 if (chan->memory == NULL) {
1492 // snd_printd("cannot allocate dma buffer: size = %d\n", size); 1493 dev_dbg(chip->card->dev,
1494 "cannot allocate dma buffer: size = %d\n", size);
1493 return -ENOMEM; 1495 return -ENOMEM;
1494 } 1496 }
1495 snd_pcm_set_runtime_buffer(substream, &chan->memory->buf); 1497 snd_pcm_set_runtime_buffer(substream, &chan->memory->buf);
@@ -1715,11 +1717,13 @@ static void es1968_measure_clock(struct es1968 *chip)
1715 1717
1716 /* search 2 APUs (although one apu is enough) */ 1718 /* search 2 APUs (although one apu is enough) */
1717 if ((apu = snd_es1968_alloc_apu_pair(chip, ESM_APU_PCM_PLAY)) < 0) { 1719 if ((apu = snd_es1968_alloc_apu_pair(chip, ESM_APU_PCM_PLAY)) < 0) {
1718 snd_printk(KERN_ERR "Hmm, cannot find empty APU pair!?\n"); 1720 dev_err(chip->card->dev, "Hmm, cannot find empty APU pair!?\n");
1719 return; 1721 return;
1720 } 1722 }
1721 if ((memory = snd_es1968_new_memory(chip, CLOCK_MEASURE_BUFSIZE)) == NULL) { 1723 if ((memory = snd_es1968_new_memory(chip, CLOCK_MEASURE_BUFSIZE)) == NULL) {
1722 snd_printk(KERN_ERR "cannot allocate dma buffer - using default clock %d\n", chip->clock); 1724 dev_warn(chip->card->dev,
1725 "cannot allocate dma buffer - using default clock %d\n",
1726 chip->clock);
1723 snd_es1968_free_apu_pair(chip, apu); 1727 snd_es1968_free_apu_pair(chip, apu);
1724 return; 1728 return;
1725 } 1729 }
@@ -1780,7 +1784,7 @@ static void es1968_measure_clock(struct es1968 *chip)
1780 else 1784 else
1781 t += stop_time.tv_usec - start_time.tv_usec; 1785 t += stop_time.tv_usec - start_time.tv_usec;
1782 if (t == 0) { 1786 if (t == 0) {
1783 snd_printk(KERN_ERR "?? calculation error..\n"); 1787 dev_err(chip->card->dev, "?? calculation error..\n");
1784 } else { 1788 } else {
1785 offset *= 1000; 1789 offset *= 1000;
1786 offset = (offset / t) * 1000 + ((offset % t) * 1000) / t; 1790 offset = (offset / t) * 1000 + ((offset % t) * 1000) / t;
@@ -1788,7 +1792,7 @@ static void es1968_measure_clock(struct es1968 *chip)
1788 if (offset >= 40000 && offset <= 50000) 1792 if (offset >= 40000 && offset <= 50000)
1789 chip->clock = (chip->clock * offset) / 48000; 1793 chip->clock = (chip->clock * offset) / 48000;
1790 } 1794 }
1791 printk(KERN_INFO "es1968: clocking to %d\n", chip->clock); 1795 dev_info(chip->card->dev, "clocking to %d\n", chip->clock);
1792 } 1796 }
1793 snd_es1968_free_memory(chip, memory); 1797 snd_es1968_free_memory(chip, memory);
1794 snd_es1968_free_apu_pair(chip, apu); 1798 snd_es1968_free_apu_pair(chip, apu);
@@ -2108,7 +2112,7 @@ static void snd_es1968_ac97_reset(struct es1968 *chip)
2108 outw(inw(ioaddr + 0x3c) & 0xfffc, ioaddr + 0x3c); 2112 outw(inw(ioaddr + 0x3c) & 0xfffc, ioaddr + 0x3c);
2109 2113
2110#if 0 /* the loop here needs to be much better if we want it.. */ 2114#if 0 /* the loop here needs to be much better if we want it.. */
2111 snd_printk(KERN_INFO "trying software reset\n"); 2115 dev_info(chip->card->dev, "trying software reset\n");
2112 /* try and do a software reset */ 2116 /* try and do a software reset */
2113 outb(0x80 | 0x7c, ioaddr + 0x30); 2117 outb(0x80 | 0x7c, ioaddr + 0x30);
2114 for (w = 0;; w++) { 2118 for (w = 0;; w++) {
@@ -2416,8 +2420,7 @@ static int es1968_resume(struct device *dev)
2416 pci_set_power_state(pci, PCI_D0); 2420 pci_set_power_state(pci, PCI_D0);
2417 pci_restore_state(pci); 2421 pci_restore_state(pci);
2418 if (pci_enable_device(pci) < 0) { 2422 if (pci_enable_device(pci) < 0) {
2419 printk(KERN_ERR "es1968: pci_enable_device failed, " 2423 dev_err(dev, "pci_enable_device failed, disabling device\n");
2420 "disabling device\n");
2421 snd_card_disconnect(card); 2424 snd_card_disconnect(card);
2422 return -EIO; 2425 return -EIO;
2423 } 2426 }
@@ -2479,7 +2482,8 @@ static int snd_es1968_create_gameport(struct es1968 *chip, int dev)
2479 2482
2480 chip->gameport = gp = gameport_allocate_port(); 2483 chip->gameport = gp = gameport_allocate_port();
2481 if (!gp) { 2484 if (!gp) {
2482 printk(KERN_ERR "es1968: cannot allocate memory for gameport\n"); 2485 dev_err(chip->card->dev,
2486 "cannot allocate memory for gameport\n");
2483 release_and_free_resource(r); 2487 release_and_free_resource(r);
2484 return -ENOMEM; 2488 return -ENOMEM;
2485 } 2489 }
@@ -2706,7 +2710,8 @@ static int snd_es1968_create(struct snd_card *card,
2706 /* check, if we can restrict PCI DMA transfers to 28 bits */ 2710 /* check, if we can restrict PCI DMA transfers to 28 bits */
2707 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || 2711 if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
2708 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { 2712 pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
2709 snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); 2713 dev_err(card->dev,
2714 "architecture does not support 28bit PCI busmaster DMA\n");
2710 pci_disable_device(pci); 2715 pci_disable_device(pci);
2711 return -ENXIO; 2716 return -ENXIO;
2712 } 2717 }
@@ -2740,7 +2745,7 @@ static int snd_es1968_create(struct snd_card *card,
2740 chip->io_port = pci_resource_start(pci, 0); 2745 chip->io_port = pci_resource_start(pci, 0);
2741 if (request_irq(pci->irq, snd_es1968_interrupt, IRQF_SHARED, 2746 if (request_irq(pci->irq, snd_es1968_interrupt, IRQF_SHARED,
2742 KBUILD_MODNAME, chip)) { 2747 KBUILD_MODNAME, chip)) {
2743 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 2748 dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
2744 snd_es1968_free(chip); 2749 snd_es1968_free(chip);
2745 return -EBUSY; 2750 return -EBUSY;
2746 } 2751 }
@@ -2770,7 +2775,7 @@ static int snd_es1968_create(struct snd_card *card,
2770 } 2775 }
2771 if (do_pm > 1) { 2776 if (do_pm > 1) {
2772 /* not matched; disabling pm */ 2777 /* not matched; disabling pm */
2773 printk(KERN_INFO "es1968: not attempting power management.\n"); 2778 dev_info(card->dev, "not attempting power management.\n");
2774 do_pm = 0; 2779 do_pm = 0;
2775 } 2780 }
2776 } 2781 }
@@ -2800,7 +2805,7 @@ static int snd_es1968_create(struct snd_card *card,
2800 for (i = 0; i < ARRAY_SIZE(snd_es1968_tea575x_gpios); i++) { 2805 for (i = 0; i < ARRAY_SIZE(snd_es1968_tea575x_gpios); i++) {
2801 chip->tea575x_tuner = i; 2806 chip->tea575x_tuner = i;
2802 if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) { 2807 if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) {
2803 snd_printk(KERN_INFO "es1968: detected TEA575x radio type %s\n", 2808 dev_info(card->dev, "detected TEA575x radio type %s\n",
2804 get_tea575x_gpio(chip)->name); 2809 get_tea575x_gpio(chip)->name);
2805 strlcpy(chip->tea.card, get_tea575x_gpio(chip)->name, 2810 strlcpy(chip->tea.card, get_tea575x_gpio(chip)->name,
2806 sizeof(chip->tea.card)); 2811 sizeof(chip->tea.card));
@@ -2899,7 +2904,7 @@ static int snd_es1968_probe(struct pci_dev *pci,
2899 MPU401_INFO_INTEGRATED | 2904 MPU401_INFO_INTEGRATED |
2900 MPU401_INFO_IRQ_HOOK, 2905 MPU401_INFO_IRQ_HOOK,
2901 -1, &chip->rmidi)) < 0) { 2906 -1, &chip->rmidi)) < 0) {
2902 printk(KERN_WARNING "es1968: skipping MPU-401 MIDI support..\n"); 2907 dev_warn(card->dev, "skipping MPU-401 MIDI support..\n");
2903 } 2908 }
2904 } 2909 }
2905 2910
@@ -2908,8 +2913,8 @@ static int snd_es1968_probe(struct pci_dev *pci,
2908#ifdef CONFIG_SND_ES1968_INPUT 2913#ifdef CONFIG_SND_ES1968_INPUT
2909 err = snd_es1968_input_register(chip); 2914 err = snd_es1968_input_register(chip);
2910 if (err) 2915 if (err)
2911 snd_printk(KERN_WARNING "Input device registration " 2916 dev_warn(card->dev,
2912 "failed with error %i", err); 2917 "Input device registration failed with error %i", err);
2913#endif 2918#endif
2914 2919
2915 snd_es1968_start_irq(chip); 2920 snd_es1968_start_irq(chip);