Skip to content

Commit 94e630a

Browse files
charleskeepaxbroonie
authored andcommitted
ASoC: dapm: Cosmetic tidy up of snd_soc_dapm_new_control
Move the function snd_soc_dapm_new_control to be next to snd_soc_dapm_new_controls and add some kernel doc for it. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3bbf5d3 commit 94e630a

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

sound/soc/soc-dapm.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3417,20 +3417,6 @@ int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
34173417
}
34183418
EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch);
34193419

3420-
struct snd_soc_dapm_widget *
3421-
snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
3422-
const struct snd_soc_dapm_widget *widget)
3423-
{
3424-
struct snd_soc_dapm_widget *w;
3425-
3426-
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3427-
w = snd_soc_dapm_new_control_unlocked(dapm, widget);
3428-
mutex_unlock(&dapm->card->dapm_mutex);
3429-
3430-
return w;
3431-
}
3432-
EXPORT_SYMBOL_GPL(snd_soc_dapm_new_control);
3433-
34343420
struct snd_soc_dapm_widget *
34353421
snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
34363422
const struct snd_soc_dapm_widget *widget)
@@ -3570,6 +3556,29 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
35703556
return ERR_PTR(ret);
35713557
}
35723558

3559+
/**
3560+
* snd_soc_dapm_new_control - create new dapm control
3561+
* @dapm: DAPM context
3562+
* @widget: widget template
3563+
*
3564+
* Creates new DAPM control based upon a template.
3565+
*
3566+
* Returns a widget pointer on success or an error pointer on failure
3567+
*/
3568+
struct snd_soc_dapm_widget *
3569+
snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
3570+
const struct snd_soc_dapm_widget *widget)
3571+
{
3572+
struct snd_soc_dapm_widget *w;
3573+
3574+
mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3575+
w = snd_soc_dapm_new_control_unlocked(dapm, widget);
3576+
mutex_unlock(&dapm->card->dapm_mutex);
3577+
3578+
return w;
3579+
}
3580+
EXPORT_SYMBOL_GPL(snd_soc_dapm_new_control);
3581+
35733582
/**
35743583
* snd_soc_dapm_new_controls - create new dapm controls
35753584
* @dapm: DAPM context

0 commit comments

Comments
 (0)