On Tegra186 and later, the number of links can go up to 72, so bump the
maximum number of links to the next power of two (128).
Fixes: f2138aed231c ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210416071147.2149109-2-thierry.reding@gmail.com
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
((codec) = simple_props_to_dai_codec(props, i)); \
(i)++)
+#define SNDRV_MAX_LINKS 128
+
struct link_info {
int link; /* number of link */
int cpu; /* turn for CPU / Codec */
- struct prop_nums num[SNDRV_MINOR_DEVICES];
+ struct prop_nums num[SNDRV_MAX_LINKS];
};
int asoc_simple_parse_daifmt(struct device *dev,
{
struct device *dev = simple_priv_to_dev(priv);
- if (li->link >= SNDRV_MINOR_DEVICES) {
+ if (li->link >= SNDRV_MAX_LINKS) {
dev_err(dev, "too many links\n");
return -EINVAL;
}
{
struct device *dev = simple_priv_to_dev(priv);
- if (li->link >= SNDRV_MINOR_DEVICES) {
+ if (li->link >= SNDRV_MAX_LINKS) {
dev_err(dev, "too many links\n");
return -EINVAL;
}
struct device_node *codec,
struct link_info *li, bool is_top)
{
- if (li->link >= SNDRV_MINOR_DEVICES) {
+ if (li->link >= SNDRV_MAX_LINKS) {
struct device *dev = simple_priv_to_dev(priv);
dev_err(dev, "too many links\n");
struct device_node *codec,
struct link_info *li, bool is_top)
{
- if (li->link >= SNDRV_MINOR_DEVICES) {
+ if (li->link >= SNDRV_MAX_LINKS) {
struct device *dev = simple_priv_to_dev(priv);
dev_err(dev, "too many links\n");