aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaroslav Kysela <[email protected]>2022-09-23 10:22:36 +0200
committerTakashi Iwai <[email protected]>2022-09-26 08:23:05 +0200
commitb23975e60a944e1a3ef419a01838fca51a29baf3 (patch)
tree7c68f273252ca413e638079bf5dbe07c78f7604a
parentef6f5494faf6a37c74990689a3bb3cee76d2544c (diff)
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
-rw-r--r--sound/pci/hda/patch_hdmi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 1863836b2685..c172640c8a41 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -151,7 +151,7 @@ struct hdmi_spec {
*/
int dev_num;
struct snd_array pins; /* struct hdmi_spec_per_pin */
- struct hdmi_pcm pcm_rec[16];
+ struct hdmi_pcm pcm_rec[8];
struct mutex pcm_lock;
struct mutex bind_lock; /* for audio component binding */
/* pcm_bitmap means which pcms have been assigned to pins*/
@@ -2299,8 +2299,8 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK];
pstr->substreams = 1;
pstr->ops = generic_ops;
- /* pcm number is less than 16 */
- if (spec->pcm_used >= 16)
+ /* pcm number is less than pcm_rec array size */
+ if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec))
break;
/* other pstr fields are set in open */
}