Commit b4860183 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: msnd: Use standard print API

Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.
Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-28-tiwai@suse.de
parent a6676811
......@@ -86,7 +86,7 @@ int snd_msnd_send_dsp_cmd(struct snd_msnd *dev, u8 cmd)
}
spin_unlock_irqrestore(&dev->lock, flags);
snd_printd(KERN_ERR LOGNAME ": Send DSP command timeout\n");
dev_dbg(dev->card->dev, LOGNAME ": Send DSP command timeout\n");
return -EIO;
}
......@@ -104,7 +104,7 @@ int snd_msnd_send_word(struct snd_msnd *dev, unsigned char high,
return 0;
}
snd_printd(KERN_ERR LOGNAME ": Send host word timeout\n");
dev_dbg(dev->card->dev, LOGNAME ": Send host word timeout\n");
return -EIO;
}
......@@ -115,7 +115,7 @@ int snd_msnd_upload_host(struct snd_msnd *dev, const u8 *bin, int len)
int i;
if (len % 3 != 0) {
snd_printk(KERN_ERR LOGNAME
dev_err(dev->card->dev, LOGNAME
": Upload host data not multiple of 3!\n");
return -EINVAL;
}
......@@ -138,7 +138,7 @@ int snd_msnd_enable_irq(struct snd_msnd *dev)
if (dev->irq_ref++)
return 0;
snd_printdd(LOGNAME ": Enabling IRQ\n");
dev_dbg(dev->card->dev, LOGNAME ": Enabling IRQ\n");
spin_lock_irqsave(&dev->lock, flags);
if (snd_msnd_wait_TXDE(dev) == 0) {
......@@ -156,7 +156,7 @@ int snd_msnd_enable_irq(struct snd_msnd *dev)
}
spin_unlock_irqrestore(&dev->lock, flags);
snd_printd(KERN_ERR LOGNAME ": Enable IRQ failed\n");
dev_dbg(dev->card->dev, LOGNAME ": Enable IRQ failed\n");
return -EIO;
}
......@@ -170,10 +170,10 @@ int snd_msnd_disable_irq(struct snd_msnd *dev)
return 0;
if (dev->irq_ref < 0)
snd_printd(KERN_WARNING LOGNAME ": IRQ ref count is %d\n",
dev->irq_ref);
dev_dbg(dev->card->dev, LOGNAME ": IRQ ref count is %d\n",
dev->irq_ref);
snd_printdd(LOGNAME ": Disabling IRQ\n");
dev_dbg(dev->card->dev, LOGNAME ": Disabling IRQ\n");
spin_lock_irqsave(&dev->lock, flags);
if (snd_msnd_wait_TXDE(dev) == 0) {
......@@ -186,7 +186,7 @@ int snd_msnd_disable_irq(struct snd_msnd *dev)
}
spin_unlock_irqrestore(&dev->lock, flags);
snd_printd(KERN_ERR LOGNAME ": Disable IRQ failed\n");
dev_dbg(dev->card->dev, LOGNAME ": Disable IRQ failed\n");
return -EIO;
}
......@@ -220,8 +220,8 @@ void snd_msnd_dsp_halt(struct snd_msnd *chip, struct file *file)
snd_msnd_send_dsp_cmd(chip, HDEX_RECORD_STOP);
snd_msnd_disable_irq(chip);
if (file) {
snd_printd(KERN_INFO LOGNAME
": Stopping read for %p\n", file);
dev_dbg(chip->card->dev, LOGNAME
": Stopping read for %p\n", file);
chip->mode &= ~FMODE_READ;
}
clear_bit(F_AUDIO_READ_INUSE, &chip->flags);
......@@ -233,8 +233,8 @@ void snd_msnd_dsp_halt(struct snd_msnd *chip, struct file *file)
}
snd_msnd_disable_irq(chip);
if (file) {
snd_printd(KERN_INFO
LOGNAME ": Stopping write for %p\n", file);
dev_dbg(chip->card->dev,
LOGNAME ": Stopping write for %p\n", file);
chip->mode &= ~FMODE_WRITE;
}
clear_bit(F_AUDIO_WRITE_INUSE, &chip->flags);
......@@ -329,12 +329,6 @@ int snd_msnd_DAPQ(struct snd_msnd *chip, int start)
++nbanks;
/* Then advance the tail */
/*
if (protect)
snd_printd(KERN_INFO "B %X %lX\n",
bank_num, xtime.tv_usec);
*/
DAPQ_tail = (++bank_num % 3) * PCTODSP_OFFSET(DAQDS__size);
writew(DAPQ_tail, chip->DAPQ + JQS_wTail);
/* Tell the DSP to play the bank */
......@@ -343,10 +337,6 @@ int snd_msnd_DAPQ(struct snd_msnd *chip, int start)
if (2 == bank_num)
break;
}
/*
if (protect)
snd_printd(KERN_INFO "%lX\n", xtime.tv_usec);
*/
/* spin_unlock_irqrestore(&chip->lock, flags); not necessary */
return nbanks;
}
......@@ -406,7 +396,7 @@ static void snd_msnd_capture_reset_queue(struct snd_msnd *chip,
#endif
chip->capturePeriodBytes = pcm_count;
snd_printdd("snd_msnd_capture_reset_queue() %i\n", pcm_count);
dev_dbg(chip->card->dev, "%s() %i\n", __func__, pcm_count);
pDAQ = chip->mappedbase + DARQ_DATA_BUFF;
......@@ -533,21 +523,21 @@ static int snd_msnd_playback_trigger(struct snd_pcm_substream *substream,
int result = 0;
if (cmd == SNDRV_PCM_TRIGGER_START) {
snd_printdd("snd_msnd_playback_trigger(START)\n");
dev_dbg(chip->card->dev, "%s(START)\n", __func__);
chip->banksPlayed = 0;
set_bit(F_WRITING, &chip->flags);
snd_msnd_DAPQ(chip, 1);
} else if (cmd == SNDRV_PCM_TRIGGER_STOP) {
snd_printdd("snd_msnd_playback_trigger(STop)\n");
dev_dbg(chip->card->dev, "%s(STOP)\n", __func__);
/* interrupt diagnostic, comment this out later */
clear_bit(F_WRITING, &chip->flags);
snd_msnd_send_dsp_cmd(chip, HDEX_PLAY_STOP);
} else {
snd_printd(KERN_ERR "snd_msnd_playback_trigger(?????)\n");
dev_dbg(chip->card->dev, "%s(?????)\n", __func__);
result = -EINVAL;
}
snd_printdd("snd_msnd_playback_trigger() ENDE\n");
dev_dbg(chip->card->dev, "%s() ENDE\n", __func__);
return result;
}
......
......@@ -42,8 +42,6 @@ static int snd_msndmidi_input_open(struct snd_rawmidi_substream *substream)
{
struct snd_msndmidi *mpu;
snd_printdd("snd_msndmidi_input_open()\n");
mpu = substream->rmidi->private_data;
mpu->substream_input = substream;
......@@ -84,8 +82,6 @@ static void snd_msndmidi_input_trigger(struct snd_rawmidi_substream *substream,
unsigned long flags;
struct snd_msndmidi *mpu;
snd_printdd("snd_msndmidi_input_trigger(, %i)\n", up);
mpu = substream->rmidi->private_data;
spin_lock_irqsave(&mpu->input_lock, flags);
if (up) {
......
This diff is collapsed.
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