diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-08-30 14:57:03 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-08-30 14:57:03 +0200 |
commit | a8729efbbb847f6ea9b06e73491ec8ddb560465e (patch) | |
tree | c2e172452158457ab238080405060110934ad9d1 /sound/soc/soc-topology.c | |
parent | f7b82b12626e10a2f5332b699cc79819ac8decc7 (diff) | |
parent | 38b7673000949ca784fcb8a9feb70d2a802befa6 (diff) | |
download | linux-a8729efbbb847f6ea9b06e73491ec8ddb560465e.tar.gz linux-a8729efbbb847f6ea9b06e73491ec8ddb560465e.tar.bz2 linux-a8729efbbb847f6ea9b06e73491ec8ddb560465e.zip |
Merge tag 'asoc-v5.15' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v5.15
Quite a quiet release this time, mostly a combination of cleanups
and a good set of new drivers.
- Lots of cleanups and improvements to the Intel drivers,
including some new systems support.
- New support for AMD Vangoh, CUI CMM-4030D-261, Mediatek
Mt8195, Renesas RZ/G2L Mediatek Mt8195, RealTek RT101P,
Renesas RZ/G2L,, Rockchip RK3568 S/PDIF.
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r-- | sound/soc/soc-topology.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 0a24d0d409d2..f6e5ac3e0314 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1035,7 +1035,6 @@ err_denum: static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg, struct snd_soc_tplg_hdr *hdr) { - struct snd_soc_tplg_ctl_hdr *control_hdr; int ret; int i; @@ -1043,8 +1042,7 @@ static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg, soc_tplg_get_offset(tplg)); for (i = 0; i < le32_to_cpu(hdr->count); i++) { - - control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos; + struct snd_soc_tplg_ctl_hdr *control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos; if (le32_to_cpu(control_hdr->size) != sizeof(*control_hdr)) { dev_err(tplg->dev, "ASoC: invalid control size\n"); @@ -1583,15 +1581,16 @@ err: static int soc_tplg_dapm_widget_elems_load(struct soc_tplg *tplg, struct snd_soc_tplg_hdr *hdr) { - struct snd_soc_tplg_dapm_widget *widget; - int ret, count, i; + int count, i; count = le32_to_cpu(hdr->count); dev_dbg(tplg->dev, "ASoC: adding %d DAPM widgets\n", count); for (i = 0; i < count; i++) { - widget = (struct snd_soc_tplg_dapm_widget *) tplg->pos; + struct snd_soc_tplg_dapm_widget *widget = (struct snd_soc_tplg_dapm_widget *) tplg->pos; + int ret; + if (le32_to_cpu(widget->size) != sizeof(*widget)) { dev_err(tplg->dev, "ASoC: invalid widget size\n"); return -EINVAL; @@ -2125,10 +2124,9 @@ static struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, const char *stream_name) { struct snd_soc_pcm_runtime *rtd; - struct snd_soc_dai_link *link; for_each_card_rtds(card, rtd) { - link = rtd->dai_link; + struct snd_soc_dai_link *link = rtd->dai_link; if (link->id != id) continue; @@ -2346,15 +2344,16 @@ err: static int soc_tplg_dai_elems_load(struct soc_tplg *tplg, struct snd_soc_tplg_hdr *hdr) { - struct snd_soc_tplg_dai *dai; int count; - int i, ret; + int i; count = le32_to_cpu(hdr->count); /* config the existing BE DAIs */ for (i = 0; i < count; i++) { - dai = (struct snd_soc_tplg_dai *)tplg->pos; + struct snd_soc_tplg_dai *dai = (struct snd_soc_tplg_dai *)tplg->pos; + int ret; + if (le32_to_cpu(dai->size) != sizeof(*dai)) { dev_err(tplg->dev, "ASoC: invalid physical DAI size\n"); return -EINVAL; @@ -2572,13 +2571,13 @@ static int soc_tplg_load_header(struct soc_tplg *tplg, /* process the topology file headers */ static int soc_tplg_process_headers(struct soc_tplg *tplg) { - struct snd_soc_tplg_hdr *hdr; int ret; tplg->pass = SOC_TPLG_PASS_START; /* process the header types from start to end */ while (tplg->pass <= SOC_TPLG_PASS_END) { + struct snd_soc_tplg_hdr *hdr; tplg->hdr_pos = tplg->fw->data; hdr = (struct snd_soc_tplg_hdr *)tplg->hdr_pos; |