Skip to contentSkip to conversation

ASoC: remove duplicated definitions

PATCH In review Kuninori Morimoto 2 participants 7 messages Aug 25, 2017 – Aug 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover ASoC: remove duplicated definitions

Hi Mark

These are v2 of "ASoC: remove duplicated definitions" patches. These are based on mark/topic/core branch

Kuninori Morimoto (3):
ASoC: remove duplicate definition of controls/num_controls
ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets
ASoC: remove duplicate definition of dapm_routes/num_dapm_routes

 include/sound/soc.h  |  6 ------
 sound/soc/soc-core.c | 28 ++++++++++++----------------
 2 files changed, 12 insertions(+), 22 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/3 ASoC: remove duplicate definition of controls/num_controls

From: Kuninori Morimoto <[email protected]>

snd_soc_component and snd_soc_component_driver both have controls/num_controls, but these are duplicated. Let's remove duplicated definition.

---
v1 -> v2

- based on mark/topic/core

 include/sound/soc.h  | 2 --
 sound/soc/soc-core.c | 9 ++++-----
 2 files changed, 4 insertions(+), 7 deletions(-)
include/sound/soc.h +0 -2
index df819f7..5d792e49 100644
@@ -862,8 +862,6 @@ struct snd_soc_component {
 	/* Don't use these, use snd_soc_component_get_dapm() */
 	struct snd_soc_dapm_context dapm;
 
-	const struct snd_kcontrol_new *controls;
-	unsigned int num_controls;
 	const struct snd_soc_dapm_widget *dapm_widgets;
 	unsigned int num_dapm_widgets;
 	const struct snd_soc_dapm_route *dapm_routes;
sound/soc/soc-core.c +4 -5
index 6fab0ff..8030da5 100644
@@ -1555,9 +1555,10 @@ static int soc_probe_component(struct snd_soc_card *card,
 		}
 	}
 
-	if (component->controls)
-		snd_soc_add_component_controls(component, component->controls,
-				     component->num_controls);
+	if (component->driver->controls)
+		snd_soc_add_component_controls(component,
+					       component->driver->controls,
+					       component->driver->num_controls);
 	if (component->dapm_routes)
 		snd_soc_dapm_add_routes(dapm, component->dapm_routes,
 					component->num_dapm_routes);
@@ -3229,8 +3230,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	if (driver->stream_event)
 		dapm->stream_event = snd_soc_component_stream_event;
 
-	component->controls = driver->controls;
-	component->num_controls = driver->num_controls;
 	component->dapm_widgets = driver->dapm_widgets;
 	component->num_dapm_widgets = driver->num_dapm_widgets;
 	component->dapm_routes = driver->dapm_routes;
Signature · 1 line
1.9.1
maintainer
#2 lore raw

Applied "ASoC: remove duplicate definition of controls/num_controls" to the asoc tree

The patch

ASoC: remove duplicate definition of controls/num_controls

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From b8972bf0521ca7ee3c8d27da0fd101fe648acfc2 Mon Sep 17 00:00:00 2001

From: Kuninori Morimoto <[email protected]>
Date: Fri, 25 Aug 2017 00:29:01 +0000
Subject: [PATCH] ASoC: remove duplicate definition of controls/num_controls

snd_soc_component and snd_soc_component_driver both have controls/num_controls, but these are duplicated. Let's remove duplicated definition.

---
 include/sound/soc.h  | 2 --
 sound/soc/soc-core.c | 9 ++++-----
 2 files changed, 4 insertions(+), 7 deletions(-)
include/sound/soc.h +0 -2
index de57a8ad057b..e4b4746032ba 100644
@@ -862,8 +862,6 @@ struct snd_soc_component {
 	/* Don't use these, use snd_soc_component_get_dapm() */
 	struct snd_soc_dapm_context dapm;
 
-	const struct snd_kcontrol_new *controls;
-	unsigned int num_controls;
 	const struct snd_soc_dapm_widget *dapm_widgets;
 	unsigned int num_dapm_widgets;
 	const struct snd_soc_dapm_route *dapm_routes;
sound/soc/soc-core.c +4 -5
index 3bb8c63564cf..1317706f8e69 100644
@@ -1495,9 +1495,10 @@ static int soc_probe_component(struct snd_soc_card *card,
 		}
 	}
 
-	if (component->controls)
-		snd_soc_add_component_controls(component, component->controls,
-				     component->num_controls);
+	if (component->driver->controls)
+		snd_soc_add_component_controls(component,
+					       component->driver->controls,
+					       component->driver->num_controls);
 	if (component->dapm_routes)
 		snd_soc_dapm_add_routes(dapm, component->dapm_routes,
 					component->num_dapm_routes);
@@ -3184,8 +3185,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	if (driver->stream_event)
 		dapm->stream_event = snd_soc_component_stream_event;
 
-	component->controls = driver->controls;
-	component->num_controls = driver->num_controls;
 	component->dapm_widgets = driver->dapm_widgets;
 	component->num_dapm_widgets = driver->num_dapm_widgets;
 	component->dapm_routes = driver->dapm_routes;
Signature · 1 line
2.13.2
#3 lore raw

PATCH v2 2/3 ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

snd_soc_component and snd_soc_component_driver both have dapm_widgets/num_dapm_widgets, but these are duplicated. Let's remove duplicated definition.

---
v1 -> v2

- based on mark/topic/core

 include/sound/soc.h  | 2 --
 sound/soc/soc-core.c | 9 ++++-----
 2 files changed, 4 insertions(+), 7 deletions(-)
include/sound/soc.h +0 -2
index 5d792e49..97dee73 100644
@@ -862,8 +862,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;
sound/soc/soc-core.c +4 -5
index 8030da5..00b71ee 100644
@@ -1511,9 +1511,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,
@@ -3230,8 +3231,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	if (driver->stream_event)
 		dapm->stream_event = snd_soc_component_stream_event;
 
-	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;
 
Signature · 1 line
1.9.1
maintainer
#4 lore raw

Applied "ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets" to the asoc tree

The patch

ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 688d0ebf49a97aa6959aebec5d177a8b821f27d1 Mon Sep 17 00:00:00 2001

From: Kuninori Morimoto <[email protected]>
Date: Fri, 25 Aug 2017 00:29:20 +0000
Subject: [PATCH] ASoC: remove duplicate definition of
dapm_widgets/num_dapm_widgets

snd_soc_component and snd_soc_component_driver both have dapm_widgets/num_dapm_widgets, but these are duplicated. Let's remove duplicated definition.

---
 include/sound/soc.h  | 2 --
 sound/soc/soc-core.c | 9 ++++-----
 2 files changed, 4 insertions(+), 7 deletions(-)
include/sound/soc.h +0 -2
index e4b4746032ba..3e0070ed6883 100644
@@ -862,8 +862,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;
sound/soc/soc-core.c +4 -5
index 1317706f8e69..3a3236dc996d 100644
@@ -1451,9 +1451,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,
@@ -3185,8 +3186,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	if (driver->stream_event)
 		dapm->stream_event = snd_soc_component_stream_event;
 
-	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;
 
Signature · 1 line
2.13.2
#5 lore raw

PATCH v2 3/3 ASoC: remove duplicate definition of dapm_routes/num_dapm_routes

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

snd_soc_component and snd_soc_component_driver both have dapm_routes/num_dapm_routes, but these are duplicated. Let's remove duplicated definition.

---
v1 -> v2

- based on mark/topic/core

 include/sound/soc.h  |  2 --
 sound/soc/soc-core.c | 10 ++++------
 2 files changed, 4 insertions(+), 8 deletions(-)
include/sound/soc.h +0 -2
index 97dee73..bd9593347 100644
@@ -862,8 +862,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_route *dapm_routes;
-	unsigned int num_dapm_routes;
 	struct snd_soc_codec *codec;
 
 	int (*probe)(struct snd_soc_component *);
sound/soc/soc-core.c +4 -6
index 00b71ee..03875ea 100644
@@ -1560,9 +1560,10 @@ static int soc_probe_component(struct snd_soc_card *card,
 		snd_soc_add_component_controls(component,
 					       component->driver->controls,
 					       component->driver->num_controls);
-	if (component->dapm_routes)
-		snd_soc_dapm_add_routes(dapm, component->dapm_routes,
-					component->num_dapm_routes);
+	if (component->driver->dapm_routes)
+		snd_soc_dapm_add_routes(dapm,
+					component->driver->dapm_routes,
+					component->driver->num_dapm_routes);
 
 	list_add(&dapm->list, &card->dapm_list);
 	list_add(&component->card_list, &card->component_dev_list);
@@ -3231,9 +3232,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	if (driver->stream_event)
 		dapm->stream_event = snd_soc_component_stream_event;
 
-	component->dapm_routes = driver->dapm_routes;
-	component->num_dapm_routes = driver->num_dapm_routes;
-
 	INIT_LIST_HEAD(&component->dai_list);
 	mutex_init(&component->io_mutex);
 
Signature · 1 line
1.9.1
maintainer
#6 lore raw

Applied "ASoC: remove duplicate definition of dapm_routes/num_dapm_routes" to the asoc tree

The patch

ASoC: remove duplicate definition of dapm_routes/num_dapm_routes

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 6969b2bae6dbe7f277a7c018b66d2f3ad662129f Mon Sep 17 00:00:00 2001

From: Kuninori Morimoto <[email protected]>
Date: Fri, 25 Aug 2017 00:29:41 +0000
Subject: [PATCH] ASoC: remove duplicate definition of
dapm_routes/num_dapm_routes

snd_soc_component and snd_soc_component_driver both have dapm_routes/num_dapm_routes, but these are duplicated. Let's remove duplicated definition.

---
 include/sound/soc.h  |  2 --
 sound/soc/soc-core.c | 10 ++++------
 2 files changed, 4 insertions(+), 8 deletions(-)
include/sound/soc.h +0 -2
index 3e0070ed6883..2bcb38045dc1 100644
@@ -862,8 +862,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_route *dapm_routes;
-	unsigned int num_dapm_routes;
 	struct snd_soc_codec *codec;
 
 	int (*probe)(struct snd_soc_component *);
sound/soc/soc-core.c +4 -6
index 3a3236dc996d..b8f96a41b594 100644
@@ -1500,9 +1500,10 @@ static int soc_probe_component(struct snd_soc_card *card,
 		snd_soc_add_component_controls(component,
 					       component->driver->controls,
 					       component->driver->num_controls);
-	if (component->dapm_routes)
-		snd_soc_dapm_add_routes(dapm, component->dapm_routes,
-					component->num_dapm_routes);
+	if (component->driver->dapm_routes)
+		snd_soc_dapm_add_routes(dapm,
+					component->driver->dapm_routes,
+					component->driver->num_dapm_routes);
 
 	list_add(&dapm->list, &card->dapm_list);
 	list_add(&component->card_list, &card->component_dev_list);
@@ -3186,9 +3187,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
 	if (driver->stream_event)
 		dapm->stream_event = snd_soc_component_stream_event;
 
-	component->dapm_routes = driver->dapm_routes;
-	component->num_dapm_routes = driver->num_dapm_routes;
-
 	INIT_LIST_HEAD(&component->dai_list);
 	mutex_init(&component->io_mutex);
 
Signature · 1 line
2.13.2