struct snd_soc_tplg_bytes_control *be;
struct soc_bytes_ext *sbe;
struct snd_kcontrol_new kc;
- int i, err;
+ int i;
+ int err = 0;
if (soc_tplg_check_elem_count(tplg,
sizeof(struct snd_soc_tplg_bytes_control), count,
if (err) {
soc_control_err(tplg, &be->hdr, be->hdr.name);
kfree(sbe);
- continue;
+ break;
}
/* pass control to driver for optional further init */
dev_err(tplg->dev, "ASoC: failed to init %s\n",
be->hdr.name);
kfree(sbe);
- continue;
+ break;
}
/* register control here */
dev_err(tplg->dev, "ASoC: failed to add %s\n",
be->hdr.name);
kfree(sbe);
- continue;
+ break;
}
list_add(&sbe->dobj.list, &tplg->comp->dobj_list);
}
- return 0;
+ return err;
}
struct snd_soc_tplg_mixer_control *mc;
struct soc_mixer_control *sm;
struct snd_kcontrol_new kc;
- int i, err;
+ int i;
+ int err = 0;
if (soc_tplg_check_elem_count(tplg,
sizeof(struct snd_soc_tplg_mixer_control),
if (err) {
soc_control_err(tplg, &mc->hdr, mc->hdr.name);
kfree(sm);
- continue;
+ break;
}
/* create any TLV data */
dev_err(tplg->dev, "ASoC: failed to create TLV %s\n",
mc->hdr.name);
kfree(sm);
- continue;
+ break;
}
/* pass control to driver for optional further init */
mc->hdr.name);
soc_tplg_free_tlv(tplg, &kc);
kfree(sm);
- continue;
+ break;
}
/* register control here */
mc->hdr.name);
soc_tplg_free_tlv(tplg, &kc);
kfree(sm);
- continue;
+ break;
}
list_add(&sm->dobj.list, &tplg->comp->dobj_list);
}
- return 0;
+ return err;
}
static int soc_tplg_denum_create_texts(struct soc_enum *se,
struct snd_soc_tplg_enum_control *ec;
struct soc_enum *se;
struct snd_kcontrol_new kc;
- int i, ret, err;
+ int i;
+ int err = 0;
if (soc_tplg_check_elem_count(tplg,
sizeof(struct snd_soc_tplg_enum_control),
"ASoC: could not create values for %s\n",
ec->hdr.name);
kfree(se);
- continue;
+ goto err_denum;
}
/* fall through */
case SND_SOC_TPLG_CTL_ENUM:
"ASoC: could not create texts for %s\n",
ec->hdr.name);
kfree(se);
- continue;
+ goto err_denum;
}
break;
default:
+ err = -EINVAL;
dev_err(tplg->dev,
"ASoC: invalid enum control type %d for %s\n",
ec->hdr.ops.info, ec->hdr.name);
kfree(se);
- continue;
+ goto err_denum;
}
/* map io handlers */
if (err) {
soc_control_err(tplg, &ec->hdr, ec->hdr.name);
kfree(se);
- continue;
+ goto err_denum;
}
/* pass control to driver for optional further init */
dev_err(tplg->dev, "ASoC: failed to init %s\n",
ec->hdr.name);
kfree(se);
- continue;
+ goto err_denum;
}
/* register control here */
- ret = soc_tplg_add_kcontrol(tplg,
- &kc, &se->dobj.control.kcontrol);
- if (ret < 0) {
+ err = soc_tplg_add_kcontrol(tplg,
+ &kc, &se->dobj.control.kcontrol);
+ if (err < 0) {
dev_err(tplg->dev, "ASoC: could not add kcontrol %s\n",
ec->hdr.name);
kfree(se);
- continue;
+ goto err_denum;
}
list_add(&se->dobj.list, &tplg->comp->dobj_list);
}
-
- return 0;
+err_denum:
+ return err;
}
static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg,
if (err < 0) {
dev_err(tplg->dev, "ASoC: failed to create TLV %s\n",
mc->hdr.name);
- kfree(sm);
- continue;
+ goto err_sm;
}
/* pass control to driver for optional further init */