All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH 20/25] ASoC: soc-component: add snd_soc_component_remove()
Date: 24 Jul 2019 10:52:53 +0900	[thread overview]
Message-ID: <87a7d4td59.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <8736iwurtc.wl-kuninori.morimoto.gx@renesas.com>


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

Current ALSA SoC is directly using component->driver->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_remove() and use it.

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

diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index d01f36a..7cef7ed 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -360,5 +360,6 @@ void snd_soc_component_suspend(struct snd_soc_component *component);
 void snd_soc_component_resume(struct snd_soc_component *component);
 int snd_soc_component_is_suspended(struct snd_soc_component *component);
 int snd_soc_component_probe(struct snd_soc_component *component);
+void snd_soc_component_remove(struct snd_soc_component *component);
 
 #endif /* __SOC_COMPONENT_H */
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 2e7f254..af26e8e 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -445,3 +445,9 @@ int snd_soc_component_probe(struct snd_soc_component *component)
 		return component->driver->probe(component);
 	return 0;
 }
+
+void snd_soc_component_remove(struct snd_soc_component *component)
+{
+	if (component->driver->remove)
+		component->driver->remove(component);
+}
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 9be12ae..067c340 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -970,8 +970,7 @@ static void soc_remove_component(struct snd_soc_component *component)
 	if (!component->card)
 		return;
 
-	if (component->driver->remove)
-		component->driver->remove(component);
+	snd_soc_component_remove(component);
 
 	soc_cleanup_component(component);
 }
-- 
2.7.4

  parent reply	other threads:[~2019-07-24  1:52 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24  1:50 [PATCH 00/25] ASoC: add soc-component.c Kuninori Morimoto
2019-07-24  1:51 ` [PATCH 01/25] " Kuninori Morimoto
2019-07-24  1:51 ` [PATCH 02/25] ASoC: soc-component: add snd_soc_component_get/put() Kuninori Morimoto
2019-07-24  9:25   ` Charles Keepax
2019-07-25  1:52     ` Kuninori Morimoto
2019-07-24  1:51 ` [PATCH 03/25] ASoC: soc-component: add snd_soc_component_open() Kuninori Morimoto
2019-07-24  1:51 ` [PATCH 04/25] ASoC: soc-component: add snd_soc_component_close() Kuninori Morimoto
2019-07-24  1:51 ` [PATCH 05/25] ASoC: soc-component: add snd_soc_component_prepare() Kuninori Morimoto
2019-07-25 19:59   ` Cezary Rojewski
2019-07-26  0:53     ` Kuninori Morimoto
2019-07-24  1:51 ` [PATCH 06/25] ASoC: soc-component: add snd_soc_component_hw_params() Kuninori Morimoto
2019-07-24  1:51 ` [PATCH 07/25] ASoC: soc-component: add snd_soc_component_hw_free() Kuninori Morimoto
2019-07-25  0:35   ` Ranjani Sridharan
2019-07-25  1:55     ` Kuninori Morimoto
2019-07-24  1:51 ` [PATCH 08/25] ASoC: soc-component: add snd_soc_component_trigger() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 09/25] ASoC: soc-component: add snd_soc_component_pointer() Kuninori Morimoto
2019-07-24  9:13   ` Charles Keepax
2019-07-24  9:26     ` Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 10/25] ASoC: soc-component: add snd_soc_component_ioctrl() Kuninori Morimoto
2019-07-24  9:23   ` Charles Keepax
2019-07-25  1:51     ` Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 11/25] ASoC: soc-component: add snd_soc_component_copy_user() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 12/25] ASoC: soc-component: add snd_soc_component_page() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 13/25] ASoC: soc-component: add snd_soc_component_mmap() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 14/25] ASoC: soc-component: add snd_soc_component_pcm_new() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 15/25] ASoC: soc-component: add snd_soc_component_pcm_free() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 16/25] ASoC: soc-component: add snd_soc_component_suspend() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 17/25] ASoC: soc-component: add snd_soc_component_resume() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 18/25] ASoC: soc-component: add snd_soc_component_is_suspended() Kuninori Morimoto
2019-07-24  1:52 ` [PATCH 19/25] ASoC: soc-component: add snd_soc_component_probe() Kuninori Morimoto
2019-07-24  1:52 ` Kuninori Morimoto [this message]
2019-07-24  1:52 ` [PATCH 21/25] ASoC: soc-component: add snd_soc_component_of_xlate_dai_id() Kuninori Morimoto
2019-07-24  1:53 ` [PATCH 22/25] ASoC: soc-component: add snd_soc_component_of_xlate_dai_name() Kuninori Morimoto
2019-07-24  1:53 ` [PATCH 23/25] ASoC: soc-component: move snd_soc_component_seq_notifier() Kuninori Morimoto
2019-07-24  9:35   ` Charles Keepax
2019-07-25  1:54     ` Kuninori Morimoto
2019-07-24  1:53 ` [PATCH 24/25] ASoC: soc-component: move snd_soc_component_stream_event() Kuninori Morimoto
2019-07-24  9:37   ` Charles Keepax
2019-07-25  1:54     ` Kuninori Morimoto
2019-07-24  1:53 ` [PATCH 25/25] ASoC: soc-component: move snd_soc_component_set_bias_level() Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7d4td59.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.