Commit 9cacb32a authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ASoC: Drop snd_soc_*_get_kcontrol_locked()



The recent cleanup in ALSA control core made no difference between
snd_ctl_find_id_mixer() and snd_ctl_find_id_mixer_locked(), and the
latter is to be dropped.  The only user of the left API was ASoC, and
that's snd_soc_card_get_kcontrol_locked() and
snd_soc_component_get_kcontrol_locked().

This patch drops those functions and rewrites those users to call the
variant without locked instead.  The test of the API became
superfluous, hence dropped as well.

As all callers of snd_ctl_find_id_mixer_locked() are gone,
snd_ctl_find_id_mixer_locked() is finally dropped, too.

Reviewed-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240809104234.8488-4-tiwai@suse.de
parent 38ea4c3d
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -165,13 +165,6 @@ snd_ctl_find_id_mixer(struct snd_card *card, const char *name)
	return snd_ctl_find_id(card, &id);
}

/* to be removed */
static inline struct snd_kcontrol *
snd_ctl_find_id_mixer_locked(struct snd_card *card, const char *name)
{
	return snd_ctl_find_id_mixer(card, name);
}

int snd_ctl_create(struct snd_card *card);

int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn);
+0 −2
Original line number Diff line number Diff line
@@ -30,8 +30,6 @@ static inline void snd_soc_card_mutex_unlock(struct snd_soc_card *card)

struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
					       const char *name);
struct snd_kcontrol *snd_soc_card_get_kcontrol_locked(struct snd_soc_card *soc_card,
						      const char *name);
int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
			  struct snd_soc_jack *jack);
int snd_soc_card_jack_new_pins(struct snd_soc_card *card, const char *id,
+0 −3
Original line number Diff line number Diff line
@@ -464,9 +464,6 @@ int snd_soc_component_force_enable_pin_unlocked(
/* component controls */
struct snd_kcontrol *snd_soc_component_get_kcontrol(struct snd_soc_component *component,
						    const char * const ctl);
struct snd_kcontrol *
snd_soc_component_get_kcontrol_locked(struct snd_soc_component *component,
				      const char * const ctl);
int snd_soc_component_notify_control(struct snd_soc_component *component,
				     const char * const ctl);

+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ static int cs35l45_activate_ctl(struct snd_soc_component *component,
	struct snd_kcontrol_volatile *vd;
	unsigned int index_offset;

	kcontrol = snd_soc_component_get_kcontrol_locked(component, ctl_name);
	kcontrol = snd_soc_component_get_kcontrol(component, ctl_name);
	if (!kcontrol) {
		dev_err(component->dev, "Can't find kcontrol %s\n", ctl_name);
		return -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ static int fsl_xcvr_activate_ctl(struct snd_soc_dai *dai, const char *name,

	lockdep_assert_held(&card->snd_card->controls_rwsem);

	kctl = snd_soc_card_get_kcontrol_locked(card, name);
	kctl = snd_soc_card_get_kcontrol(card, name);
	if (kctl == NULL)
		return -ENOENT;

Loading