1 From aaf04413a17530437872ec909f2af1fb012e9954 Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Tue, 4 Sep 2018 17:58:40 +0200
4 Subject: [PATCH 447/725] staging: bcm2835-audio: Use PCM runtime values
7 commit b8f7fdd50890b848e085c0519469aed4ff4d9b54 upstream.
9 Some fields in alsa_stream are the values we keep already in PCM
10 runtime object, hence they are redundant. Use the standard PCM
11 runtime values instead of the private copies.
13 Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 23 ++++---------------
18 .../vc04_services/bcm2835-audio/bcm2835.h | 4 ----
19 2 files changed, 4 insertions(+), 23 deletions(-)
21 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
22 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
23 @@ -206,22 +206,7 @@ static int snd_bcm2835_playback_close(st
24 static int snd_bcm2835_pcm_hw_params(struct snd_pcm_substream *substream,
25 struct snd_pcm_hw_params *params)
27 - struct snd_pcm_runtime *runtime = substream->runtime;
28 - struct bcm2835_alsa_stream *alsa_stream = runtime->private_data;
31 - err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
34 - (" pcm_lib_malloc failed to allocated pages for buffers\n");
38 - alsa_stream->channels = params_channels(params);
39 - alsa_stream->params_rate = params_rate(params);
40 - alsa_stream->pcm_format_width = snd_pcm_format_width(params_format(params));
43 + return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
46 /* hw_free callback */
47 @@ -248,11 +233,11 @@ static int snd_bcm2835_pcm_prepare(struc
48 if (chip->spdif_status & IEC958_AES0_NONAUDIO)
51 - channels = alsa_stream->channels;
52 + channels = runtime->channels;
54 err = bcm2835_audio_set_params(alsa_stream, channels,
55 - alsa_stream->params_rate,
56 - alsa_stream->pcm_format_width);
58 + snd_pcm_format_width(runtime->format));
60 audio_error(" error setting hw params\n");
62 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
63 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
64 @@ -121,10 +121,6 @@ struct bcm2835_alsa_stream {
70 - int pcm_format_width;
73 unsigned int buffer_size;
74 unsigned int period_size;