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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SDCA: remove the max count of initialization table

The number of the initialization table may exceed 2048.
Therefore, this patch removes the limitation and allows the driver to
allocate memory dynamically based on the size of the initialization table.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260325092017.3221640-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shuming Fan and committed by
Mark Brown
c991ca32 cfb385a8

-8
-5
include/sound/sdca_function.h
··· 27 27 #define SDCA_MAX_ENTITY_COUNT 128 28 28 29 29 /* 30 - * Sanity check on number of initialization writes, can be expanded if needed. 31 - */ 32 - #define SDCA_MAX_INIT_COUNT 2048 33 - 34 - /* 35 30 * The Cluster IDs are 16-bit, so a maximum of 65535 Clusters per 36 31 * function can be represented, however limit this to a slightly 37 32 * more reasonable value. Can be expanded if needed.
-3
sound/soc/sdca/sdca_functions.c
··· 216 216 } else if (num_init_writes % sizeof(*raw) != 0) { 217 217 dev_err(dev, "%pfwP: init table size invalid\n", function_node); 218 218 return -EINVAL; 219 - } else if ((num_init_writes / sizeof(*raw)) > SDCA_MAX_INIT_COUNT) { 220 - dev_err(dev, "%pfwP: maximum init table size exceeded\n", function_node); 221 - return -EINVAL; 222 219 } 223 220 224 221 raw = kzalloc(num_init_writes, GFP_KERNEL);