aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-06-16 12:13:02 -0400
committerMark Brown <broonie@linaro.org>2014-06-21 16:04:24 -0400
commitf4333203ec933f9272c90c7add01774ec2cf94d3 (patch)
tree4a7f0bd37c7a5d00105dd91980fca721e181bee4
parent94f99c875c109e51decf0d8c25ec2c946db20c56 (diff)
ASoC: Move name and id from CODEC/platform to component
The component struct already has a name and id field which are initialized to the same values as the same fields in the CODEC and platform structs. So remove them from the CODEC and platform structs and used the ones from the component struct instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--include/sound/soc.h4
-rw-r--r--include/trace/events/asoc.h6
-rw-r--r--sound/soc/codecs/tlv320dac33.c2
-rw-r--r--sound/soc/soc-cache.c7
-rw-r--r--sound/soc/soc-compress.c8
-rw-r--r--sound/soc/soc-core.c53
-rw-r--r--sound/soc/soc-dapm.c8
-rw-r--r--sound/soc/soc-pcm.c4
8 files changed, 38 insertions, 54 deletions
<
diff --git a/include/sound/soc.h b/include/sound/soc.h
index e1cce0042f8a..f64bf9452466 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -710,8 +710,6 @@ struct snd_soc_component {
710 710
711/* SoC Audio Codec device */ 711/* SoC Audio Codec device */
712struct snd_soc_codec { 712struct snd_soc_codec {
713 const char *name;
714 int id;
715 struct device *dev; 713 struct device *dev;
716 const struct snd_soc_codec_driver *driver; 714 const struct snd_soc_codec_driver *driver;
717 715
@@ -848,8 +846,6 @@ struct snd_soc_platform_driver {
848}; 846};
849 847
850struct snd_soc_platform { 848struct snd_soc_platform {
851 const char *name;
852 int id;
853 struct device *dev; 849 struct device *dev;
854 const struct snd_soc_platform_driver *driver; 850 const struct snd_soc_platform_driver *driver;
855 851
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h
index c75c795a377b..0194a641e4e2 100644
--- a/include/trace/events/asoc.h
+++ b/include/trace/events/asoc.h
@@ -296,17 +296,17 @@ TRACE_EVENT(snd_soc_cache_sync,
296 TP_ARGS(codec, type, status), 296 TP_ARGS(codec, type, status),
297 297
298 TP_STRUCT__entry( 298 TP_STRUCT__entry(
299 __string( name, codec->name ) 299 __string( name, codec->component.name)
300 __string( status, status ) 300 __string( status, status )
301 __string( type, type ) 301 __string( type, type )
302 __field( int, id ) 302 __field( int, id )
303 ), 303 ),
304 304
305 TP_fast_assign( 305 TP_fast_assign(
306 __assign_str(name, codec->name); 306 __assign_str(name, codec->component.name);
307 __assign_str(status, status); 307 __assign_str(status, status);
308 __assign_str(type, type); 308 __assign_str(type, type);
309 __entry->id = codec->id; 309 __entry->id = codec->component.id;
310 ), 310 ),
311 311
312 TP_printk("codec=%s.%d type=%s status=%s", __get_str(name), 312 TP_printk("codec=%s.%d type=%s status=%s", __get_str(name),
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index df3a7506c023..ff006cc95520 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -1404,7 +1404,7 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
1404 if (dac33->irq >= 0) { 1404 if (dac33->irq >= 0) {
1405 ret = request_irq(dac33->irq, dac33_interrupt_handler, 1405 ret = request_irq(dac33->irq, dac33_interrupt_handler,
1406 IRQF_TRIGGER_RISING, 1406 IRQF_TRIGGER_RISING,
1407 codec->name, codec); 1407 codec->component.name, codec);
1408 if (ret < 0) { 1408 if (ret < 0) {
1409 dev_err(codec->dev, "Could not request IRQ%d (%d)\n", 1409 dev_err(codec->dev, "Could not request IRQ%d (%d)\n",
1410 dac33->irq, ret); 1410 dac33->irq, ret);
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 00e70b6c7da2..a9f82b5aba9d 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -78,7 +78,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
78 mutex_init(&codec->cache_rw_mutex); 78 mutex_init(&codec->cache_rw_mutex);
79 79
80 dev_dbg(codec->dev, "ASoC: Initializing cache for %s codec\n", 80 dev_dbg(codec->dev, "ASoC: Initializing cache for %s codec\n",
81 codec->name); 81 codec->component.name);
82 82
83 if (codec_drv->reg_cache_default) 83 if (codec_drv->reg_cache_default)
84 codec->reg_cache = kmemdup(codec_drv->reg_cache_default, 84 codec->reg_cache = kmemdup(codec_drv->reg_cache_default,
@@ -98,8 +98,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
98int snd_soc_cache_exit(struct snd_soc_codec *codec) 98int snd_soc_cache_exit(struct snd_soc_codec *codec)
99{ 99{
100 dev_dbg(codec->dev, "ASoC: Destroying cache for %s codec\n", 100 dev_dbg(codec->dev, "ASoC: Destroying cache for %s codec\n",
101 codec->name); 101 codec->component.name);
102
103 kfree(codec->reg_cache); 102 kfree(codec->reg_cache);
104 codec->reg_cache = NULL; 103 codec->reg_cache = NULL;
105 return 0; 104 return 0;
@@ -192,7 +191,7 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec)
192 return 0; 191 return 0;
193 192
194 dev_dbg(codec->dev, "ASoC: Syncing cache for %s codec\n", 193 dev_dbg(codec->dev, "ASoC: Syncing cache for %s codec\n",
195 codec->name); 194 codec->component.name);
196 trace_snd_soc_cache_sync(codec, name, "start"); 195 trace_snd_soc_cache_sync(codec, name, "start");
197 ret = snd_soc_flat_cache_sync(codec); 196 ret = snd_soc_flat_cache_sync(codec);
198 if (!ret) 197 if (!ret)
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 10f7f1da2aca..f96fb96b2678 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -37,7 +37,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
37 if (platform->driver->compr_ops && platform->driver->compr_ops->open) { 37 if (platform->driver->compr_ops && platform->driver->compr_ops->open) {
38 ret = platform->driver->compr_ops->open(cstream); 38 ret = platform->driver->compr_ops->open(cstream);
39 if (ret < 0) { 39 if (ret < 0) {
40 pr_err("compress asoc: can't open platform %s\n", platform->name); 40 pr_err("compress asoc: can't open platform %s\n",
41 platform->component.name);
41 goto out; 42 goto out;
42 } 43 }
43 } 44 }
@@ -84,7 +85,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
84 if (platform->driver->compr_ops && platform->driver->compr_ops->open) { 85 if (platform->driver->compr_ops && platform->driver->compr_ops->open) {
85 ret = platform->driver->compr_ops->open(cstream); 86 ret = platform->driver->compr_ops->open(cstream);
86 if (ret < 0) { 87 if (ret < 0) {
87 pr_err("compress asoc: can't open platform %s\n", platform->name); 88 pr_err("compress asoc: can't open platform %s\n",
89 platform->component.name);
88 goto out; 90 goto out;
89 } 91 }
90 } 92 }
@@ -680,7 +682,7 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
680 ret = snd_compress_new(rtd->card->snd_card, num, direction, compr); 682 ret = snd_compress_new(rtd->card->snd_card, num, direction, compr);
681 if (ret < 0) { 683 if (ret < 0) {
682 pr_err("compress asoc: can't create compress for codec %s\n", 684 pr_err("compress asoc: can't create compress for codec %s\n",
683 codec->name); 685 codec->component.name);
684 goto compr_err; 686 goto compr_err;
685 } 687 }
686 688
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ba822e927187..b8cc88a9f947 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -274,7 +274,7 @@ static void soc_init_codec_debugfs(struct snd_soc_codec *codec)
274{ 274{
275 struct dentry *debugfs_card_root = codec->card->debugfs_card_root; 275 struct dentry *debugfs_card_root = codec->card->debugfs_card_root;
276 276
277 codec->debugfs_codec_root = debugfs_create_dir(codec->name, 277 codec->debugfs_codec_root = debugfs_create_dir(codec->component.name,
278 debugfs_card_root); 278 debugfs_card_root);
279 if (!codec->debugfs_codec_root) { 279 if (!codec->debugfs_codec_root) {
280 dev_warn(codec->dev, 280 dev_warn(codec->dev,
@@ -306,8 +306,8 @@ static void soc_init_platform_debugfs(struct snd_soc_platform *platform)
306{ 306{
307 struct dentry *debugfs_card_root = platform->card->debugfs_card_root; 307 struct dentry *debugfs_card_root = platform->card->debugfs_card_root;
308 308
309 platform->debugfs_platform_root = debugfs_create_dir(platform->name, 309 platform->debugfs_platform_root = debugfs_create_dir(
310 debugfs_card_root); 310 platform->component.name, debugfs_card_root);
311 if (!platform->debugfs_platform_root) { 311 if (!platform->debugfs_platform_root) {
312 dev_warn(platform->dev, 312 dev_warn(platform->dev,
313 "ASoC: Failed to create platform debugfs directory\n"); 313 "ASoC: Failed to create platform debugfs directory\n");
@@ -335,7 +335,7 @@ static ssize_t codec_list_read_file(struct file *file, char __user *user_buf,
335 335
336 list_for_each_entry(codec, &codec_list, list) { 336 list_for_each_entry(codec, &codec_list, list) {
337 len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n", 337 len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
338 codec->name); 338 codec->component.name);
339 if (len >= 0) 339 if (len >= 0)
340 ret += len; 340 ret += len;
341 if (ret > PAGE_SIZE) {