1 From e109804fa00a139a05626c1b8ceebcfe3577fc6d Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Tue, 4 Sep 2018 17:58:44 +0200
4 Subject: [PATCH] staging: bcm2835-audio: Drop debug messages in
7 commit 055e1c330d04df87d4730a5db837161c11ddaafc upstream.
9 These debug messages worsen the code readability a lot while they give
10 little debuggability (which we already have via tracing, in anyway).
12 Let's clean them up. This allows us to reduce the
13 snd_bcm2835_pcm_lib_ioctl() function to be a direct call of the
14 snd_pcm_lib_ioctl callback (like most other drivers do), too.
16 Signed-off-by: Takashi Iwai <tiwai@suse.de>
17 Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 51 +++----------------
21 1 file changed, 7 insertions(+), 44 deletions(-)
23 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
24 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
25 @@ -44,9 +44,7 @@ static const struct snd_pcm_hardware snd
27 static void snd_bcm2835_playback_free(struct snd_pcm_runtime *runtime)
29 - audio_info("Freeing up alsa stream here ..\n");
30 kfree(runtime->private_data);
31 - runtime->private_data = NULL;
34 void bcm2835_playback_fifo(struct bcm2835_alsa_stream *alsa_stream)
35 @@ -99,7 +97,6 @@ static int snd_bcm2835_playback_open_gen
38 mutex_lock(&chip->audio_mutex);
39 - audio_info("Alsa open (%d)\n", substream->number);
40 idx = substream->number;
42 if (spdif && chip->opened) {
43 @@ -182,8 +179,6 @@ static int snd_bcm2835_playback_close(st
44 runtime = substream->runtime;
45 alsa_stream = runtime->private_data;
47 - audio_info("Alsa close\n");
49 alsa_stream->period_size = 0;
50 alsa_stream->buffer_size = 0;
52 @@ -251,10 +246,6 @@ static int snd_bcm2835_pcm_prepare(struc
54 alsa_stream->draining = false;
56 - audio_debug("buffer_size=%d, period_size=%d pos=%d frame_bits=%d\n",
57 - alsa_stream->buffer_size, alsa_stream->period_size,
58 - alsa_stream->pos, runtime->frame_bits);
61 mutex_unlock(&chip->audio_mutex);
63 @@ -266,12 +257,8 @@ static void snd_bcm2835_pcm_transfer(str
64 struct snd_pcm_runtime *runtime = substream->runtime;
65 struct bcm2835_alsa_stream *alsa_stream = runtime->private_data;
66 void *src = (void *) (substream->runtime->dma_area + rec->sw_data);
69 - err = bcm2835_audio_write(alsa_stream, bytes, src);
71 - audio_error(" Failed to transfer to alsa device (%d)\n", err);
73 + bcm2835_audio_write(alsa_stream, bytes, src);
76 static int snd_bcm2835_pcm_ack(struct snd_pcm_substream *substream)
77 @@ -289,27 +276,18 @@ static int snd_bcm2835_pcm_trigger(struc
79 struct snd_pcm_runtime *runtime = substream->runtime;
80 struct bcm2835_alsa_stream *alsa_stream = runtime->private_data;
84 case SNDRV_PCM_TRIGGER_START:
85 - err = bcm2835_audio_start(alsa_stream);
87 - audio_error(" Failed to START alsa device (%d)\n", err);
89 + return bcm2835_audio_start(alsa_stream);
90 case SNDRV_PCM_TRIGGER_DRAIN:
91 alsa_stream->draining = true;
94 case SNDRV_PCM_TRIGGER_STOP:
95 - err = bcm2835_audio_stop(alsa_stream);
97 - audio_error(" Failed to STOP alsa device (%d)\n", err);
99 + return bcm2835_audio_stop(alsa_stream);
108 /* pointer callback */
109 @@ -319,31 +297,16 @@ snd_bcm2835_pcm_pointer(struct snd_pcm_s
110 struct snd_pcm_runtime *runtime = substream->runtime;
111 struct bcm2835_alsa_stream *alsa_stream = runtime->private_data;
113 - audio_debug("pcm_pointer... (%d) hwptr=%d appl=%d pos=%d\n", 0,
114 - frames_to_bytes(runtime, runtime->status->hw_ptr),
115 - frames_to_bytes(runtime, runtime->control->appl_ptr),
118 return snd_pcm_indirect_playback_pointer(substream,
119 &alsa_stream->pcm_indirect,
123 -static int snd_bcm2835_pcm_lib_ioctl(struct snd_pcm_substream *substream,
124 - unsigned int cmd, void *arg)
126 - int ret = snd_pcm_lib_ioctl(substream, cmd, arg);
128 - audio_info(" .. substream=%p, cmd=%d, arg=%p (%x) ret=%d\n", substream,
129 - cmd, arg, arg ? *(unsigned int *)arg : 0, ret);
134 static const struct snd_pcm_ops snd_bcm2835_playback_ops = {
135 .open = snd_bcm2835_playback_open,
136 .close = snd_bcm2835_playback_close,
137 - .ioctl = snd_bcm2835_pcm_lib_ioctl,
138 + .ioctl = snd_pcm_lib_ioctl,
139 .hw_params = snd_bcm2835_pcm_hw_params,
140 .hw_free = snd_bcm2835_pcm_hw_free,
141 .prepare = snd_bcm2835_pcm_prepare,
142 @@ -355,7 +318,7 @@ static const struct snd_pcm_ops snd_bcm2
143 static const struct snd_pcm_ops snd_bcm2835_playback_spdif_ops = {
144 .open = snd_bcm2835_playback_spdif_open,
145 .close = snd_bcm2835_playback_close,
146 - .ioctl = snd_bcm2835_pcm_lib_ioctl,
147 + .ioctl = snd_pcm_lib_ioctl,
148 .hw_params = snd_bcm2835_pcm_hw_params,
149 .hw_free = snd_bcm2835_pcm_hw_free,
150 .prepare = snd_bcm2835_pcm_prepare,