提交 179bb7f1 编写于 作者: T Takashi Iwai

ALSA: aw2: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.
A couple of prints are difficult to convert with dev_err() so they are
converted to pr_err() at least.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 5f1e6937
...@@ -262,7 +262,7 @@ static int snd_aw2_create(struct snd_card *card, ...@@ -262,7 +262,7 @@ static int snd_aw2_create(struct snd_card *card,
/* check PCI availability (32bit DMA) */ /* check PCI availability (32bit DMA) */
if ((pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) || if ((pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0) ||
(pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0)) { (pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0)) {
printk(KERN_ERR "aw2: Impossible to set 32bit mask DMA\n"); dev_err(card->dev, "Impossible to set 32bit mask DMA\n");
pci_disable_device(pci); pci_disable_device(pci);
return -ENXIO; return -ENXIO;
} }
...@@ -290,7 +290,7 @@ static int snd_aw2_create(struct snd_card *card, ...@@ -290,7 +290,7 @@ static int snd_aw2_create(struct snd_card *card,
pci_resource_len(pci, 0)); pci_resource_len(pci, 0));
if (chip->iobase_virt == NULL) { if (chip->iobase_virt == NULL) {
printk(KERN_ERR "aw2: unable to remap memory region"); dev_err(card->dev, "unable to remap memory region");
pci_release_regions(pci); pci_release_regions(pci);
pci_disable_device(pci); pci_disable_device(pci);
kfree(chip); kfree(chip);
...@@ -302,7 +302,7 @@ static int snd_aw2_create(struct snd_card *card, ...@@ -302,7 +302,7 @@ static int snd_aw2_create(struct snd_card *card,
if (request_irq(pci->irq, snd_aw2_saa7146_interrupt, if (request_irq(pci->irq, snd_aw2_saa7146_interrupt,
IRQF_SHARED, KBUILD_MODNAME, chip)) { IRQF_SHARED, KBUILD_MODNAME, chip)) {
printk(KERN_ERR "aw2: Cannot grab irq %d\n", pci->irq); dev_err(card->dev, "Cannot grab irq %d\n", pci->irq);
iounmap(chip->iobase_virt); iounmap(chip->iobase_virt);
pci_release_regions(chip->pci); pci_release_regions(chip->pci);
...@@ -324,9 +324,8 @@ static int snd_aw2_create(struct snd_card *card, ...@@ -324,9 +324,8 @@ static int snd_aw2_create(struct snd_card *card,
*rchip = chip; *rchip = chip;
printk(KERN_INFO dev_info(card->dev,
"Audiowerk 2 sound card (saa7146 chipset) detected and " "Audiowerk 2 sound card (saa7146 chipset) detected and managed\n");
"managed\n");
return 0; return 0;
} }
...@@ -399,7 +398,7 @@ static int snd_aw2_pcm_playback_open(struct snd_pcm_substream *substream) ...@@ -399,7 +398,7 @@ static int snd_aw2_pcm_playback_open(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
snd_printdd(KERN_DEBUG "aw2: Playback_open\n"); dev_dbg(substream->pcm->card->dev, "Playback_open\n");
runtime->hw = snd_aw2_playback_hw; runtime->hw = snd_aw2_playback_hw;
return 0; return 0;
} }
...@@ -415,7 +414,7 @@ static int snd_aw2_pcm_capture_open(struct snd_pcm_substream *substream) ...@@ -415,7 +414,7 @@ static int snd_aw2_pcm_capture_open(struct snd_pcm_substream *substream)
{ {
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
snd_printdd(KERN_DEBUG "aw2: Capture_open\n"); dev_dbg(substream->pcm->card->dev, "Capture_open\n");
runtime->hw = snd_aw2_capture_hw; runtime->hw = snd_aw2_capture_hw;
return 0; return 0;
} }
...@@ -603,7 +602,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip) ...@@ -603,7 +602,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip)
err = snd_pcm_new(chip->card, "Audiowerk2 analog playback", 0, 1, 0, err = snd_pcm_new(chip->card, "Audiowerk2 analog playback", 0, 1, 0,
&pcm_playback_ana); &pcm_playback_ana);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "aw2: snd_pcm_new error (0x%X)\n", err); dev_err(chip->card->dev, "snd_pcm_new error (0x%X)\n", err);
return err; return err;
} }
...@@ -633,14 +632,15 @@ static int snd_aw2_new_pcm(struct aw2 *chip) ...@@ -633,14 +632,15 @@ static int snd_aw2_new_pcm(struct aw2 *chip)
(chip->pci), (chip->pci),
64 * 1024, 64 * 1024); 64 * 1024, 64 * 1024);
if (err) if (err)
printk(KERN_ERR "aw2: snd_pcm_lib_preallocate_pages_for_all " dev_err(chip->card->dev,
"error (0x%X)\n", err); "snd_pcm_lib_preallocate_pages_for_all error (0x%X)\n",
err);
err = snd_pcm_new(chip->card, "Audiowerk2 digital playback", 1, 1, 0, err = snd_pcm_new(chip->card, "Audiowerk2 digital playback", 1, 1, 0,
&pcm_playback_num); &pcm_playback_num);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "aw2: snd_pcm_new error (0x%X)\n", err); dev_err(chip->card->dev, "snd_pcm_new error (0x%X)\n", err);
return err; return err;
} }
/* Creation ok */ /* Creation ok */
...@@ -669,17 +669,15 @@ static int snd_aw2_new_pcm(struct aw2 *chip) ...@@ -669,17 +669,15 @@ static int snd_aw2_new_pcm(struct aw2 *chip)
(chip->pci), (chip->pci),
64 * 1024, 64 * 1024); 64 * 1024, 64 * 1024);
if (err) if (err)
printk(KERN_ERR dev_err(chip->card->dev,
"aw2: snd_pcm_lib_preallocate_pages_for_all error " "snd_pcm_lib_preallocate_pages_for_all error (0x%X)\n",
"(0x%X)\n", err); err);
err = snd_pcm_new(chip->card, "Audiowerk2 capture", 2, 0, 1, err = snd_pcm_new(chip->card, "Audiowerk2 capture", 2, 0, 1,
&pcm_capture); &pcm_capture);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "aw2: snd_pcm_new error (0x%X)\n", err); dev_err(chip->card->dev, "snd_pcm_new error (0x%X)\n", err);
return err; return err;
} }
...@@ -709,15 +707,15 @@ static int snd_aw2_new_pcm(struct aw2 *chip) ...@@ -709,15 +707,15 @@ static int snd_aw2_new_pcm(struct aw2 *chip)
(chip->pci), (chip->pci),
64 * 1024, 64 * 1024); 64 * 1024, 64 * 1024);
if (err) if (err)
printk(KERN_ERR dev_err(chip->card->dev,
"aw2: snd_pcm_lib_preallocate_pages_for_all error " "snd_pcm_lib_preallocate_pages_for_all error (0x%X)\n",
"(0x%X)\n", err); err);
/* Create control */ /* Create control */
err = snd_ctl_add(chip->card, snd_ctl_new1(&aw2_control, chip)); err = snd_ctl_add(chip->card, snd_ctl_new1(&aw2_control, chip));
if (err < 0) { if (err < 0) {
printk(KERN_ERR "aw2: snd_ctl_add error (0x%X)\n", err); dev_err(chip->card->dev, "snd_ctl_add error (0x%X)\n", err);
return err; return err;
} }
......
...@@ -204,8 +204,7 @@ void snd_aw2_saa7146_pcm_init_playback(struct snd_aw2_saa7146 *chip, ...@@ -204,8 +204,7 @@ void snd_aw2_saa7146_pcm_init_playback(struct snd_aw2_saa7146 *chip,
/* Define upper limit for DMA access */ /* Define upper limit for DMA access */
WRITEREG(dma_addr + buffer_size, ProtA1_out); WRITEREG(dma_addr + buffer_size, ProtA1_out);
} else { } else {
printk(KERN_ERR pr_err("aw2: snd_aw2_saa7146_pcm_init_playback: "
"aw2: snd_aw2_saa7146_pcm_init_playback: "
"Substream number is not 0 or 1 -> not managed\n"); "Substream number is not 0 or 1 -> not managed\n");
} }
} }
...@@ -251,8 +250,7 @@ void snd_aw2_saa7146_pcm_init_capture(struct snd_aw2_saa7146 *chip, ...@@ -251,8 +250,7 @@ void snd_aw2_saa7146_pcm_init_capture(struct snd_aw2_saa7146 *chip,
/* Define upper limit for DMA access */ /* Define upper limit for DMA access */
WRITEREG(dma_addr + buffer_size, ProtA1_in); WRITEREG(dma_addr + buffer_size, ProtA1_in);
} else { } else {
printk(KERN_ERR pr_err("aw2: snd_aw2_saa7146_pcm_init_capture: "
"aw2: snd_aw2_saa7146_pcm_init_capture: "
"Substream number is not 0 -> not managed\n"); "Substream number is not 0 -> not managed\n");
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册