diff options
author | Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> | 2024-06-27 12:18:41 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-07-02 14:27:00 +0100 |
commit | 52f4f7272c92d5be3988839a33be41b180bbc28e (patch) | |
tree | aed363b718abe6627f13b3267abf1e64c1bd180a /sound/soc | |
parent | 8ec2a2643544ce352f012ad3d248163199d05dfc (diff) | |
download | lwn-52f4f7272c92d5be3988839a33be41b180bbc28e.tar.gz lwn-52f4f7272c92d5be3988839a33be41b180bbc28e.zip |
ASoC: topology: Cleanup soc_tplg_dapm_widget_dbytes_create
Minor cleanups to increase readability.
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-topology.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 15c006c47d80..73e127975822 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1249,25 +1249,22 @@ static int soc_tplg_dapm_widget_dbytes_create(struct soc_tplg *tplg, struct snd_ be = (struct snd_soc_tplg_bytes_control *)tplg->pos; /* validate kcontrol */ - if (strnlen(be->hdr.name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == - SNDRV_CTL_ELEM_ID_NAME_MAXLEN) + if (strnlen(be->hdr.name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == SNDRV_CTL_ELEM_ID_NAME_MAXLEN) return -EINVAL; sbe = devm_kzalloc(tplg->dev, sizeof(*sbe), GFP_KERNEL); if (!sbe) return -ENOMEM; - tplg->pos += (sizeof(struct snd_soc_tplg_bytes_control) + - le32_to_cpu(be->priv.size)); + tplg->pos += (sizeof(struct snd_soc_tplg_bytes_control) + le32_to_cpu(be->priv.size)); - dev_dbg(tplg->dev, - "ASoC: adding bytes kcontrol %s with access 0x%x\n", + dev_dbg(tplg->dev, "ASoC: adding bytes kcontrol %s with access 0x%x\n", be->hdr.name, be->hdr.access); - kc->private_value = (long)sbe; kc->name = devm_kstrdup(tplg->dev, be->hdr.name, GFP_KERNEL); if (!kc->name) return -ENOMEM; + kc->private_value = (long)sbe; kc->iface = SNDRV_CTL_ELEM_IFACE_MIXER; kc->access = le32_to_cpu(be->hdr.access); @@ -1281,11 +1278,7 @@ static int soc_tplg_dapm_widget_dbytes_create(struct soc_tplg *tplg, struct snd_ } /* pass control to driver for optional further init */ - err = soc_tplg_control_load(tplg, kc, &be->hdr); - if (err < 0) - return err; - - return 0; + return soc_tplg_control_load(tplg, kc, &be->hdr); } static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, |