[alsa-devel] [PATCH 2/3] ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Thu Aug 24 03:03:47 CEST 2017
From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
snd_soc_component and snd_soc_component_driver both have
dapm_widgets/num_dapm_widgets, but these are duplicated.
Let's remove duplicated definition.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
include/sound/soc.h | 2 --
sound/soc/soc-core.c | 9 ++++-----
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 368c75c..674cdf8 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -868,8 +868,6 @@ struct snd_soc_component {
/* Don't use these, use snd_soc_component_get_dapm() */
struct snd_soc_dapm_context dapm;
- const struct snd_soc_dapm_widget *dapm_widgets;
- unsigned int num_dapm_widgets;
const struct snd_soc_dapm_route *dapm_routes;
unsigned int num_dapm_routes;
struct snd_soc_codec *codec;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 20cfc63..14221ca 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1486,9 +1486,10 @@ static int soc_probe_component(struct snd_soc_card *card,
soc_init_component_debugfs(component);
- if (component->dapm_widgets) {
- ret = snd_soc_dapm_new_controls(dapm, component->dapm_widgets,
- component->num_dapm_widgets);
+ if (component->driver->dapm_widgets) {
+ ret = snd_soc_dapm_new_controls(dapm,
+ component->driver->dapm_widgets,
+ component->driver->num_dapm_widgets);
if (ret != 0) {
dev_err(component->dev,
@@ -3247,8 +3248,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
if (driver->set_bias_level)
dapm->set_bias_level = snd_soc_component_set_bias_level;
- component->dapm_widgets = driver->dapm_widgets;
- component->num_dapm_widgets = driver->num_dapm_widgets;
component->dapm_routes = driver->dapm_routes;
component->num_dapm_routes = driver->num_dapm_routes;
--
1.9.1
More information about the Alsa-devel
mailing list