Commit 747ce5b3 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: maestro3: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 813bdba3
...@@ -1403,7 +1403,7 @@ static int snd_m3_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -1403,7 +1403,7 @@ static int snd_m3_pcm_hw_params(struct snd_pcm_substream *substream,
/* set buffer address */ /* set buffer address */
s->buffer_addr = substream->runtime->dma_addr; s->buffer_addr = substream->runtime->dma_addr;
if (s->buffer_addr & 0x3) { if (s->buffer_addr & 0x3) {
snd_printk(KERN_ERR "oh my, not aligned\n"); dev_err(substream->pcm->card->dev, "oh my, not aligned\n");
s->buffer_addr = s->buffer_addr & ~0x3; s->buffer_addr = s->buffer_addr & ~0x3;
} }
return 0; return 0;
...@@ -1900,7 +1900,7 @@ static int snd_m3_ac97_wait(struct snd_m3 *chip) ...@@ -1900,7 +1900,7 @@ static int snd_m3_ac97_wait(struct snd_m3 *chip)
cpu_relax(); cpu_relax();
} while (i-- > 0); } while (i-- > 0);
snd_printk(KERN_ERR "ac97 serial bus busy\n"); dev_err(chip->card->dev, "ac97 serial bus busy\n");
return 1; return 1;
} }
...@@ -2015,7 +2015,8 @@ static void snd_m3_ac97_reset(struct snd_m3 *chip) ...@@ -2015,7 +2015,8 @@ static void snd_m3_ac97_reset(struct snd_m3 *chip)
delay1 += 10; delay1 += 10;
delay2 += 100; delay2 += 100;
snd_printd("maestro3: retrying codec reset with delays of %d and %d ms\n", dev_dbg(chip->card->dev,
"retrying codec reset with delays of %d and %d ms\n",
delay1, delay2); delay1, delay2);
} }
...@@ -2194,7 +2195,8 @@ static int snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma *s, int in ...@@ -2194,7 +2195,8 @@ static int snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma *s, int in
address = 0x1100 + ((data_bytes/2) * index); address = 0x1100 + ((data_bytes/2) * index);
if ((address + (data_bytes/2)) >= 0x1c00) { if ((address + (data_bytes/2)) >= 0x1c00) {
snd_printk(KERN_ERR "no memory for %d bytes at ind %d (addr 0x%x)\n", dev_err(chip->card->dev,
"no memory for %d bytes at ind %d (addr 0x%x)\n",
data_bytes, index, address); data_bytes, index, address);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2439,8 +2441,7 @@ static int m3_resume(struct device *dev) ...@@ -2439,8 +2441,7 @@ static int m3_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 "maestor3: 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;
} }
...@@ -2553,7 +2554,8 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, ...@@ -2553,7 +2554,8 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
/* check, if we can restrict PCI DMA transfers to 28 bits */ /* check, if we can restrict PCI DMA transfers to 28 bits */
if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
snd_printk(KERN_ERR "architecture does not support 28bit PCI busmaster DMA\n"); dev_err(card->dev,
"architecture does not support 28bit PCI busmaster DMA\n");
pci_disable_device(pci); pci_disable_device(pci);
return -ENXIO; return -ENXIO;
} }
...@@ -2586,8 +2588,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, ...@@ -2586,8 +2588,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
else { else {
quirk = snd_pci_quirk_lookup(pci, m3_amp_quirk_list); quirk = snd_pci_quirk_lookup(pci, m3_amp_quirk_list);
if (quirk) { if (quirk) {
snd_printdd(KERN_INFO dev_info(card->dev, "set amp-gpio for '%s'\n",
"maestro3: set amp-gpio for '%s'\n",
snd_pci_quirk_name(quirk)); snd_pci_quirk_name(quirk));
chip->amp_gpio = quirk->value; chip->amp_gpio = quirk->value;
} else if (chip->allegro_flag) } else if (chip->allegro_flag)
...@@ -2598,8 +2599,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, ...@@ -2598,8 +2599,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
quirk = snd_pci_quirk_lookup(pci, m3_irda_quirk_list); quirk = snd_pci_quirk_lookup(pci, m3_irda_quirk_list);
if (quirk) { if (quirk) {
snd_printdd(KERN_INFO dev_info(card->dev, "enabled irda workaround for '%s'\n",
"maestro3: enabled irda workaround for '%s'\n",
snd_pci_quirk_name(quirk)); snd_pci_quirk_name(quirk));
chip->irda_workaround = 1; chip->irda_workaround = 1;
} }
...@@ -2652,7 +2652,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, ...@@ -2652,7 +2652,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
if (request_irq(pci->irq, snd_m3_interrupt, IRQF_SHARED, if (request_irq(pci->irq, snd_m3_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_m3_free(chip); snd_m3_free(chip);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2661,7 +2661,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, ...@@ -2661,7 +2661,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
chip->suspend_mem = vmalloc(sizeof(u16) * (REV_B_CODE_MEMORY_LENGTH + REV_B_DATA_MEMORY_LENGTH)); chip->suspend_mem = vmalloc(sizeof(u16) * (REV_B_CODE_MEMORY_LENGTH + REV_B_DATA_MEMORY_LENGTH));
if (chip->suspend_mem == NULL) if (chip->suspend_mem == NULL)
snd_printk(KERN_WARNING "can't allocate apm buffer\n"); dev_warn(card->dev, "can't allocate apm buffer\n");
#endif #endif
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
...@@ -2685,8 +2685,9 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, ...@@ -2685,8 +2685,9 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
if (chip->hv_config & HV_CTRL_ENABLE) { if (chip->hv_config & HV_CTRL_ENABLE) {
err = snd_m3_input_register(chip); err = snd_m3_input_register(chip);
if (err) if (err)
snd_printk(KERN_WARNING "Input device registration " dev_warn(card->dev,
"failed with error %i", err); "Input device registration failed with error %i",
err);
} }
#endif #endif
...@@ -2763,7 +2764,7 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) ...@@ -2763,7 +2764,7 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
MPU401_INFO_INTEGRATED | MPU401_INFO_IRQ_HOOK, MPU401_INFO_INTEGRATED | MPU401_INFO_IRQ_HOOK,
-1, &chip->rmidi); -1, &chip->rmidi);
if (err < 0) if (err < 0)
printk(KERN_WARNING "maestro3: no MIDI support.\n"); dev_warn(card->dev, "no MIDI support.\n");
#endif #endif
pci_set_drvdata(pci, card); pci_set_drvdata(pci, card);
......
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