Unverified Commit c991ca32 authored by Shuming Fan's avatar Shuming Fan Committed by Mark Brown
Browse files

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: default avatarShuming Fan <shumingf@realtek.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260325092017.3221640-1-shumingf@realtek.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent cfb385a8
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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
+0 −3
Original line number Diff line number Diff line
@@ -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);