]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SDCA: remove the max count of initialization table
authorShuming Fan <shumingf@realtek.com>
Wed, 25 Mar 2026 09:20:17 +0000 (17:20 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 25 Mar 2026 12:17:43 +0000 (12:17 +0000)
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>
include/sound/sdca_function.h
sound/soc/sdca/sdca_functions.c

index 79bd5a7a0f884ee205e6653fdee35cd7f4fbb932..0e871c786513f671383a6d20a4a3bb5179a6c8e8 100644 (file)
@@ -26,11 +26,6 @@ struct sdca_function_desc;
  */
 #define SDCA_MAX_ENTITY_COUNT 128
 
-/*
- * Sanity check on number of initialization writes, can be expanded if needed.
- */
-#define SDCA_MAX_INIT_COUNT 2048
-
 /*
  * The Cluster IDs are 16-bit, so a maximum of 65535 Clusters per
  * function can be represented, however limit this to a slightly
index e0ed593697ba01d8eca1ef521e39542e9d765671..d27ffb25ad97ee7a337bdfa5ec7fbf6ef47f5e2f 100644 (file)
@@ -216,9 +216,6 @@ static int find_sdca_init_table(struct device *dev,
        } else if (num_init_writes % sizeof(*raw) != 0) {
                dev_err(dev, "%pfwP: init table size invalid\n", function_node);
                return -EINVAL;
-       } else if ((num_init_writes / sizeof(*raw)) > SDCA_MAX_INIT_COUNT) {
-               dev_err(dev, "%pfwP: maximum init table size exceeded\n", function_node);
-               return -EINVAL;
        }
 
        raw = kzalloc(num_init_writes, GFP_KERNEL);