[PATCH v5 04/12] ASoC: soc-component: add snd_soc_component_{set_}name()

Kuninori Morimoto <[email protected]>
Newsgroups org.kernel.vger.linux-sound
Message-ID <[email protected]>
struct snd_soc_component will be capsuled soon, its member will not be
able to access from non soc-component.c.

Add snd_soc_component_{set_}name() to access name.

Signed-off-by: Kuninori Morimoto <[email protected]>
Reviewed-by: Cezary Rojewski <[email protected]>
---
 include/sound/soc-component.h |  4 ++++
 sound/soc/soc-component.c     | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index 3c628402e289b..61aa6523f2f75 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -283,6 +283,10 @@ static inline int snd_soc_component_cache_sync(
 }
 
 struct snd_soc_component *snd_soc_component_alloc(struct device *dev);
+
+void snd_soc_component_set_name(struct snd_soc_component *component, const char *name);
+const char *snd_soc_component_name(struct snd_soc_component *component);
+
 void snd_soc_component_set_aux(struct snd_soc_component *component,
 			       struct snd_soc_aux_dev *aux);
 int snd_soc_component_init(struct snd_soc_component *component);
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index f0506a9c36ec9..625714293fbb4 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -42,6 +42,18 @@ struct snd_soc_component *snd_soc_component_alloc(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(snd_soc_component_alloc);
 
+void snd_soc_component_set_name(struct snd_soc_component *component, const char *name)
+{
+	component->name = name;
+}
+EXPORT_SYMBOL_GPL(snd_soc_component_set_name);
+
+const char *snd_soc_component_name(struct snd_soc_component *component)
+{
+	return component->name;
+}
+EXPORT_SYMBOL_GPL(snd_soc_component_name);
+
 /*
  * We might want to check substream by using list.
  * In such case, we can update these macros.
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.