Commit fac24b0f authored by Jason Wang's avatar Jason Wang Committed by Takashi Iwai

ALSA: pcxhr: use __func__ to get funcion's name in an output message

Prefer using '"%s...", __func__' to get current function's name in
an output message.
Signed-off-by: default avatarJason Wang <wangborong@cdjrlc.com>
Link: https://lore.kernel.org/r/20210731052647.141046-1-wangborong@cdjrlc.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c5aa8277
...@@ -366,7 +366,7 @@ static int pcxhr_sub_set_clock(struct pcxhr_mgr *mgr, ...@@ -366,7 +366,7 @@ static int pcxhr_sub_set_clock(struct pcxhr_mgr *mgr,
mgr->codec_speed = speed; /* save new codec speed */ mgr->codec_speed = speed; /* save new codec speed */
} }
dev_dbg(&mgr->pci->dev, "pcxhr_sub_set_clock to %dHz (realfreq=%d)\n", dev_dbg(&mgr->pci->dev, "%s to %dHz (realfreq=%d)\n", __func__,
rate, realfreq); rate, realfreq);
return 0; return 0;
} }
...@@ -499,7 +499,7 @@ static int pcxhr_set_stream_state(struct snd_pcxhr *chip, ...@@ -499,7 +499,7 @@ static int pcxhr_set_stream_state(struct snd_pcxhr *chip,
else { else {
if (stream->status != PCXHR_STREAM_STATUS_SCHEDULE_STOP) { if (stream->status != PCXHR_STREAM_STATUS_SCHEDULE_STOP) {
dev_err(chip->card->dev, dev_err(chip->card->dev,
"pcxhr_set_stream_state CANNOT be stopped\n"); "%s CANNOT be stopped\n", __func__);
return -EINVAL; return -EINVAL;
} }
start = 0; start = 0;
...@@ -524,7 +524,7 @@ static int pcxhr_set_stream_state(struct snd_pcxhr *chip, ...@@ -524,7 +524,7 @@ static int pcxhr_set_stream_state(struct snd_pcxhr *chip,
err = pcxhr_send_msg(chip->mgr, &rmh); err = pcxhr_send_msg(chip->mgr, &rmh);
if (err) if (err)
dev_err(chip->card->dev, dev_err(chip->card->dev,
"ERROR pcxhr_set_stream_state err=%x;\n", err); "ERROR %s err=%x;\n", __func__, err);
stream->status = stream->status =
start ? PCXHR_STREAM_STATUS_STARTED : PCXHR_STREAM_STATUS_STOPPED; start ? PCXHR_STREAM_STATUS_STARTED : PCXHR_STREAM_STATUS_STOPPED;
return err; return err;
...@@ -570,7 +570,7 @@ static int pcxhr_set_format(struct pcxhr_stream *stream) ...@@ -570,7 +570,7 @@ static int pcxhr_set_format(struct pcxhr_stream *stream)
break; break;
default: default:
dev_err(chip->card->dev, dev_err(chip->card->dev,
"error pcxhr_set_format() : unknown format\n"); "error %s() : unknown format\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -615,7 +615,7 @@ static int pcxhr_set_format(struct pcxhr_stream *stream) ...@@ -615,7 +615,7 @@ static int pcxhr_set_format(struct pcxhr_stream *stream)
err = pcxhr_send_msg(chip->mgr, &rmh); err = pcxhr_send_msg(chip->mgr, &rmh);
if (err) if (err)
dev_err(chip->card->dev, dev_err(chip->card->dev,
"ERROR pcxhr_set_format err=%x;\n", err); "ERROR %s err=%x;\n", __func__, err);
return err; return err;
} }
...@@ -630,7 +630,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream) ...@@ -630,7 +630,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream)
stream_num = is_capture ? 0 : subs->number; stream_num = is_capture ? 0 : subs->number;
dev_dbg(chip->card->dev, dev_dbg(chip->card->dev,
"pcxhr_update_r_buffer(pcm%c%d) : addr(%p) bytes(%zx) subs(%d)\n", "%s(pcm%c%d) : addr(%p) bytes(%zx) subs(%d)\n", __func__,
is_capture ? 'c' : 'p', is_capture ? 'c' : 'p',
chip->chip_idx, (void *)(long)subs->runtime->dma_addr, chip->chip_idx, (void *)(long)subs->runtime->dma_addr,
subs->runtime->dma_bytes, subs->number); subs->runtime->dma_bytes, subs->number);
...@@ -721,21 +721,20 @@ static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr) ...@@ -721,21 +721,20 @@ static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr)
} }
if (capture_mask == 0 && playback_mask == 0) { if (capture_mask == 0 && playback_mask == 0) {
mutex_unlock(&mgr->setup_mutex); mutex_unlock(&mgr->setup_mutex);
dev_err(&mgr->pci->dev, "pcxhr_start_linked_stream : no pipes\n"); dev_err(&mgr->pci->dev, "%s : no pipes\n", __func__);
return; return;
} }
dev_dbg(&mgr->pci->dev, "pcxhr_start_linked_stream : " dev_dbg(&mgr->pci->dev, "%s : playback_mask=%x capture_mask=%x\n",
"playback_mask=%x capture_mask=%x\n", __func__, playback_mask, capture_mask);
playback_mask, capture_mask);
/* synchronous stop of all the pipes concerned */ /* synchronous stop of all the pipes concerned */
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0); err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
if (err) { if (err) {
mutex_unlock(&mgr->setup_mutex); mutex_unlock(&mgr->setup_mutex);
dev_err(&mgr->pci->dev, "pcxhr_start_linked_stream : " dev_err(&mgr->pci->dev, "%s : "
"error stop pipes (P%x C%x)\n", "error stop pipes (P%x C%x)\n",
playback_mask, capture_mask); __func__, playback_mask, capture_mask);
return; return;
} }
...@@ -778,9 +777,9 @@ static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr) ...@@ -778,9 +777,9 @@ static void pcxhr_start_linked_stream(struct pcxhr_mgr *mgr)
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1); err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1);
if (err) { if (err) {
mutex_unlock(&mgr->setup_mutex); mutex_unlock(&mgr->setup_mutex);
dev_err(&mgr->pci->dev, "pcxhr_start_linked_stream : " dev_err(&mgr->pci->dev, "%s : "
"error start pipes (P%x C%x)\n", "error start pipes (P%x C%x)\n",
playback_mask, capture_mask); __func__, playback_mask, capture_mask);
return; return;
} }
...@@ -889,7 +888,7 @@ static int pcxhr_hardware_timer(struct pcxhr_mgr *mgr, int start) ...@@ -889,7 +888,7 @@ static int pcxhr_hardware_timer(struct pcxhr_mgr *mgr, int start)
} }
err = pcxhr_send_msg(mgr, &rmh); err = pcxhr_send_msg(mgr, &rmh);
if (err < 0) if (err < 0)
dev_err(&mgr->pci->dev, "error pcxhr_hardware_timer err(%x)\n", dev_err(&mgr->pci->dev, "error %s err(%x)\n", __func__,
err); err);
return err; return err;
} }
...@@ -904,7 +903,7 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs) ...@@ -904,7 +903,7 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
int err = 0; int err = 0;
dev_dbg(chip->card->dev, dev_dbg(chip->card->dev,
"pcxhr_prepare : period_size(%lx) periods(%x) buffer_size(%lx)\n", "%s : period_size(%lx) periods(%x) buffer_size(%lx)\n", __func__,
subs->runtime->period_size, subs->runtime->periods, subs->runtime->period_size, subs->runtime->periods,
subs->runtime->buffer_size); subs->runtime->buffer_size);
...@@ -997,12 +996,12 @@ static int pcxhr_open(struct snd_pcm_substream *subs) ...@@ -997,12 +996,12 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
runtime->hw = pcxhr_caps; runtime->hw = pcxhr_caps;
if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) { if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) {
dev_dbg(chip->card->dev, "pcxhr_open playback chip%d subs%d\n", dev_dbg(chip->card->dev, "%s playback chip%d subs%d\n",
chip->chip_idx, subs->number); __func__, chip->chip_idx, subs->number);
stream = &chip->playback_stream[subs->number]; stream = &chip->playback_stream[subs->number];
} else { } else {
dev_dbg(chip->card->dev, "pcxhr_open capture chip%d subs%d\n", dev_dbg(chip->card->dev, "%s capture chip%d subs%d\n",
chip->chip_idx, subs->number); __func__, chip->chip_idx, subs->number);
if (mgr->mono_capture) if (mgr->mono_capture)
runtime->hw.channels_max = 1; runtime->hw.channels_max = 1;
else else
...@@ -1011,8 +1010,8 @@ static int pcxhr_open(struct snd_pcm_substream *subs) ...@@ -1011,8 +1010,8 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
} }
if (stream->status != PCXHR_STREAM_STATUS_FREE){ if (stream->status != PCXHR_STREAM_STATUS_FREE){
/* streams in use */ /* streams in use */
dev_err(chip->card->dev, "pcxhr_open chip%d subs%d in use\n", dev_err(chip->card->dev, "%s chip%d subs%d in use\n",
chip->chip_idx, subs->number); __func__, chip->chip_idx, subs->number);
mutex_unlock(&mgr->setup_mutex); mutex_unlock(&mgr->setup_mutex);
return -EBUSY; return -EBUSY;
} }
...@@ -1077,7 +1076,7 @@ static int pcxhr_close(struct snd_pcm_substream *subs) ...@@ -1077,7 +1076,7 @@ static int pcxhr_close(struct snd_pcm_substream *subs)
mutex_lock(&mgr->setup_mutex); mutex_lock(&mgr->setup_mutex);
dev_dbg(chip->card->dev, "pcxhr_close chip%d subs%d\n", dev_dbg(chip->card->dev, "%s chip%d subs%d\n", __func__,
chip->chip_idx, subs->number); chip->chip_idx, subs->number);
/* sample rate released */ /* sample rate released */
...@@ -1572,7 +1571,7 @@ static int pcxhr_probe(struct pci_dev *pci, ...@@ -1572,7 +1571,7 @@ static int pcxhr_probe(struct pci_dev *pci,
/* init setup mutex*/ /* init setup mutex*/
mutex_init(&mgr->setup_mutex); mutex_init(&mgr->setup_mutex);
mgr->prmh = kmalloc(sizeof(*mgr->prmh) + mgr->prmh = kmalloc(sizeof(*mgr->prmh) +
sizeof(u32) * (PCXHR_SIZE_MAX_LONG_STATUS - sizeof(u32) * (PCXHR_SIZE_MAX_LONG_STATUS -
PCXHR_SIZE_MAX_STATUS), PCXHR_SIZE_MAX_STATUS),
GFP_KERNEL); GFP_KERNEL);
......
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