Commit f71ff0d713a85f647c16fbe44d2a12bbcc25add3

Authored by Takashi Iwai
1 parent af65cbf296

ALSA: hda - Moved snd_print_pcm_rates() back into hda_proc.c

Since hda_proc.c is now the only user of snd_print_pcm_rates(), better to
put it back locally to hda_proc.c and revert to the old style.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 4 changed files with 11 additions and 30 deletions Side-by-side Diff

sound/pci/hda/hda_codec.c
... ... @@ -5200,30 +5200,6 @@
5200 5200 EXPORT_SYMBOL_HDA(snd_array_free);
5201 5201  
5202 5202 /**
5203   - * snd_print_pcm_rates - Print the supported PCM rates to the string buffer
5204   - * @pcm: PCM caps bits
5205   - * @buf: the string buffer to write
5206   - * @buflen: the max buffer length
5207   - *
5208   - * used by hda_proc.c
5209   - */
5210   -void snd_print_pcm_rates(int pcm, char *buf, int buflen)
5211   -{
5212   - static unsigned int rates[] = {
5213   - 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200,
5214   - 96000, 176400, 192000, 384000
5215   - };
5216   - int i, j;
5217   -
5218   - for (i = 0, j = 0; i < ARRAY_SIZE(rates); i++)
5219   - if (pcm & (1 << i))
5220   - j += snprintf(buf + j, buflen - j, " %d", rates[i]);
5221   -
5222   - buf[j] = '\0'; /* necessary when j == 0 */
5223   -}
5224   -EXPORT_SYMBOL_HDA(snd_print_pcm_rates);
5225   -
5226   -/**
5227 5203 * snd_print_pcm_bits - Print the supported PCM fmt bits to the string buffer
5228 5204 * @pcm: PCM caps bits
5229 5205 * @buf: the string buffer to write
sound/pci/hda/hda_eld.c
... ... @@ -383,6 +383,8 @@
383 383 buf[j] = '\0'; /* necessary when j == 0 */
384 384 }
385 385  
  386 +#define SND_PRINT_RATES_ADVISED_BUFSIZE 80
  387 +
386 388 static void hdmi_show_short_audio_desc(struct cea_sad *a)
387 389 {
388 390 char buf[SND_PRINT_RATES_ADVISED_BUFSIZE];
sound/pci/hda/hda_local.h
... ... @@ -336,9 +336,6 @@
336 336 static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; }
337 337 #endif
338 338  
339   -#define SND_PRINT_RATES_ADVISED_BUFSIZE 80
340   -void snd_print_pcm_rates(int pcm, char *buf, int buflen);
341   -
342 339 #define SND_PRINT_BITS_ADVISED_BUFSIZE 16
343 340 void snd_print_pcm_bits(int pcm, char *buf, int buflen);
344 341  
sound/pci/hda/hda_proc.c
... ... @@ -152,12 +152,18 @@
152 152  
153 153 static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm)
154 154 {
155   - char buf[SND_PRINT_RATES_ADVISED_BUFSIZE];
  155 + static unsigned int rates[] = {
  156 + 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200,
  157 + 96000, 176400, 192000, 384000
  158 + };
  159 + int i;
156 160  
157 161 pcm &= AC_SUPPCM_RATES;
158 162 snd_iprintf(buffer, " rates [0x%x]:", pcm);
159   - snd_print_pcm_rates(pcm, buf, sizeof(buf));
160   - snd_iprintf(buffer, "%s\n", buf);
  163 + for (i = 0; i < ARRAY_SIZE(rates); i++)
  164 + if (pcm & (1 << i))
  165 + snd_iprintf(buffer, " %d", rates[i]);
  166 + snd_iprintf(buffer, "\n");
161 167 }
162 168  
163 169 static void print_pcm_bits(struct snd_info_buffer *buffer, unsigned int pcm)