Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: hda/hdmi: Limit the maximal count of PCM devices to 8

The current hardware has up to 4 converters. Save little space.
The limit 8 is enough even for a more improved hardware.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220923082236.61024-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Jaroslav Kysela and committed by
Takashi Iwai
b23975e6 ef6f5494

+3 -3
+3 -3
sound/pci/hda/patch_hdmi.c
··· 151 151 */ 152 152 int dev_num; 153 153 struct snd_array pins; /* struct hdmi_spec_per_pin */ 154 - struct hdmi_pcm pcm_rec[16]; 154 + struct hdmi_pcm pcm_rec[8]; 155 155 struct mutex pcm_lock; 156 156 struct mutex bind_lock; /* for audio component binding */ 157 157 /* pcm_bitmap means which pcms have been assigned to pins*/ ··· 2299 2299 pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK]; 2300 2300 pstr->substreams = 1; 2301 2301 pstr->ops = generic_ops; 2302 - /* pcm number is less than 16 */ 2303 - if (spec->pcm_used >= 16) 2302 + /* pcm number is less than pcm_rec array size */ 2303 + if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec)) 2304 2304 break; 2305 2305 /* other pstr fields are set in open */ 2306 2306 }