for (i = 0; i < ARRAY_SIZE(mchp_pdmc_snd_controls); i++) {
const struct snd_kcontrol_new *control = &mchp_pdmc_snd_controls[i];
struct snd_ctl_elem_id id;
- struct snd_kcontrol *kctl;
int err;
if (component->name_prefix)
id.device = control->device;
id.subdevice = control->subdevice;
id.index = control->index;
- kctl = snd_ctl_find_id(component->card->snd_card, &id);
- if (!kctl) {
- dev_err(component->dev, "Failed to find %s\n", control->name);
- continue;
- }
- err = snd_ctl_remove(component->card->snd_card, kctl);
- if (err < 0) {
+ err = snd_ctl_remove_id(component->card->snd_card, &id);
+ if (err < 0)
dev_err(component->dev, "%d: Failed to remove %s\n", err,
control->name);
- continue;
- }
}
return 0;