All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: remove duplicated definitions
@ 2017-08-24  1:02 Kuninori Morimoto
  2017-08-24  1:03 ` [PATCH 1/3] ASoC: remove duplicate definition of controls/num_controls Kuninori Morimoto
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2017-08-24  1:02 UTC (permalink / raw)
  To: Mark Brown, Lars-Peter; +Cc: Linux-ALSA, Simon


Hi Mark, Lars-Peter

This is not a big-deal, but I think these are duplicated definitions.
These patches cleanup it.

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(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ASoC: remove duplicate definition of controls/num_controls
  2017-08-24  1:02 [PATCH 0/3] ASoC: remove duplicated definitions Kuninori Morimoto
@ 2017-08-24  1:03 ` Kuninori Morimoto
  2017-08-24 13:50   ` Mark Brown
  2017-08-24  1:03 ` [PATCH 2/3] ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets Kuninori Morimoto
  2017-08-24  1:04 ` [PATCH 3/3] ASoC: remove duplicate definition of dapm_routes/num_dapm_routes Kuninori Morimoto
  2 siblings, 1 reply; 5+ messages in thread
From: Kuninori Morimoto @ 2017-08-24  1:03 UTC (permalink / raw)
  To: Mark Brown, Lars-Peter; +Cc: Linux-ALSA, Simon

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@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 bb62a29..368c75c 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_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;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 65999df..20cfc63 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1530,9 +1530,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);
@@ -3246,8 +3247,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->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;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets
  2017-08-24  1:02 [PATCH 0/3] ASoC: remove duplicated definitions Kuninori Morimoto
  2017-08-24  1:03 ` [PATCH 1/3] ASoC: remove duplicate definition of controls/num_controls Kuninori Morimoto
@ 2017-08-24  1:03 ` Kuninori Morimoto
  2017-08-24  1:04 ` [PATCH 3/3] ASoC: remove duplicate definition of dapm_routes/num_dapm_routes Kuninori Morimoto
  2 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2017-08-24  1:03 UTC (permalink / raw)
  To: Mark Brown, Lars-Peter; +Cc: Linux-ALSA, Simon

From: Kuninori Morimoto <kuninori.morimoto.gx@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@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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ASoC: remove duplicate definition of dapm_routes/num_dapm_routes
  2017-08-24  1:02 [PATCH 0/3] ASoC: remove duplicated definitions Kuninori Morimoto
  2017-08-24  1:03 ` [PATCH 1/3] ASoC: remove duplicate definition of controls/num_controls Kuninori Morimoto
  2017-08-24  1:03 ` [PATCH 2/3] ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets Kuninori Morimoto
@ 2017-08-24  1:04 ` Kuninori Morimoto
  2 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2017-08-24  1:04 UTC (permalink / raw)
  To: Mark Brown, Lars-Peter; +Cc: Linux-ALSA, Simon

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h  |  2 --
 sound/soc/soc-core.c | 10 ++++------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 674cdf8..231e76b 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_route *dapm_routes;
-	unsigned int num_dapm_routes;
 	struct snd_soc_codec *codec;
 
 	int (*probe)(struct snd_soc_component *);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 14221ca..360129f 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1535,9 +1535,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);
@@ -3248,9 +3249,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_routes = driver->dapm_routes;
-	component->num_dapm_routes = driver->num_dapm_routes;
-
 	INIT_LIST_HEAD(&component->dai_list);
 	mutex_init(&component->io_mutex);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ASoC: remove duplicate definition of controls/num_controls
  2017-08-24  1:03 ` [PATCH 1/3] ASoC: remove duplicate definition of controls/num_controls Kuninori Morimoto
@ 2017-08-24 13:50   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2017-08-24 13:50 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Lars-Peter, Simon


[-- Attachment #1.1: Type: text/plain, Size: 354 bytes --]

On Thu, Aug 24, 2017 at 01:03:32AM +0000, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> snd_soc_component and snd_soc_component_driver both have
> controls/num_controls, but these are duplicated.
> Let's remove duplicated definition.

This doesn't apply against current code, please check and resend.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-24 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-24  1:02 [PATCH 0/3] ASoC: remove duplicated definitions Kuninori Morimoto
2017-08-24  1:03 ` [PATCH 1/3] ASoC: remove duplicate definition of controls/num_controls Kuninori Morimoto
2017-08-24 13:50   ` Mark Brown
2017-08-24  1:03 ` [PATCH 2/3] ASoC: remove duplicate definition of dapm_widgets/num_dapm_widgets Kuninori Morimoto
2017-08-24  1:04 ` [PATCH 3/3] ASoC: remove duplicate definition of dapm_routes/num_dapm_routes Kuninori Morimoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.