aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc-dapm.h1
-rw-r--r--include/sound/soc.h9
-rw-r--r--sound/soc/codecs/Kconfig2
-rw-r--r--sound/soc/soc-core.c29
-rw-r--r--sound/soc/soc-dapm.c1
-rw-r--r--sound/soc/soc-io.c5
6 files changed, 21 insertions, 26 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 44a30b108683..d4609029f014 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -566,7 +566,6 @@ struct snd_soc_dapm_update {
566 566
567/* DAPM context */ 567/* DAPM context */
568struct snd_soc_dapm_context { 568struct snd_soc_dapm_context {
569 int n_widgets; /* number of widgets in this context */
570 enum snd_soc_bias_level bias_level; 569 enum snd_soc_bias_level bias_level;
571 enum snd_soc_bias_level suspend_bias_level; 570 enum snd_soc_bias_level suspend_bias_level;
572 struct delayed_work delayed_work; 571 struct delayed_work delayed_work;
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 44c9cbdc9fa2..9eb0e4db4835 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -373,7 +373,7 @@ int snd_soc_suspend(struct device *dev);
373int snd_soc_resume(struct device *dev); 373int snd_soc_resume(struct device *dev);
374int snd_soc_poweroff(struct device *dev); 374int snd_soc_poweroff(struct device *dev);
375int snd_soc_register_platform(struct device *dev, 375int snd_soc_register_platform(struct device *dev,
376 struct snd_soc_platform_driver *platform_drv); 376 const struct snd_soc_platform_driver *platform_drv);
377void snd_soc_unregister_platform(struct device *dev); 377void snd_soc_unregister_platform(struct device *dev);
378int snd_soc_register_codec(struct device *dev, 378int snd_soc_register_codec(struct device *dev,
379 const struct snd_soc_codec_driver *codec_drv, 379 const struct snd_soc_codec_driver *codec_drv,
@@ -807,10 +807,10 @@ struct snd_soc_platform_driver {
807 struct snd_soc_dai *); 807 struct snd_soc_dai *);
808 808
809 /* platform stream pcm ops */ 809 /* platform stream pcm ops */
810 struct snd_pcm_ops *ops; 810 const struct snd_pcm_ops *ops;
811 811
812 /* platform stream compress ops */ 812 /* platform stream compress ops */
813 struct snd_compr_ops *compr_ops; 813 const struct snd_compr_ops *compr_ops;
814 814
815 /* platform stream completion event */ 815 /* platform stream completion event */
816 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); 816 int (*stream_event)(struct snd_soc_dapm_context *dapm, int event);
@@ -829,7 +829,7 @@ struct snd_soc_platform {
829 const char *name; 829 const char *name;
830 int id; 830 int id;
831 struct device *dev; 831 struct device *dev;
832 struct snd_soc_platform_driver *driver; 832 const struct snd_soc_platform_driver *driver;
833 struct mutex mutex; 833 struct mutex mutex;
834 834
835 unsigned int suspended:1; /* platform is suspended */ 835 unsigned int suspended:1; /* platform is suspended */
@@ -1106,7 +1106,6 @@ struct soc_enum {
1106 unsigned int mask; 1106 unsigned int mask;
1107 const char * const *texts; 1107 const char * const *texts;
1108 const unsigned int *values; 1108 const unsigned int *values;
1109 void *dapm;
1110}; 1109};
1111 1110
1112/* codec IO */ 1111/* codec IO */
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 500f666c3875..cf7b9897fa6b 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -328,7 +328,7 @@ config SND_SOC_TLV320AIC23
328 tristate 328 tristate
329 329
330config SND_SOC_TLV320AIC26 330config SND_SOC_TLV320AIC26
331 tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE 331 tristate
332 depends on SPI 332 depends on SPI
333 333
334config SND_SOC_TLV320AIC32X4 334config SND_SOC_TLV320AIC32X4
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 45aa1d3a4a52..7bf21a1035ea 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3905,7 +3905,7 @@ static void snd_soc_unregister_dais(struct device *dev, size_t count)
3905 * @platform: platform to register 3905 * @platform: platform to register
3906 */ 3906 */
3907int snd_soc_register_platform(struct device *dev, 3907int snd_soc_register_platform(struct device *dev,
3908 struct snd_soc_platform_driver *platform_drv) 3908 const struct snd_soc_platform_driver *platform_drv)
3909{ 3909{
3910 struct snd_soc_platform *platform; 3910 struct snd_soc_platform *platform;
3911 3911
@@ -4021,8 +4021,8 @@ int snd_soc_register_codec(struct device *dev,
4021 /* create CODEC component name */ 4021 /* create CODEC component name */
4022 codec->name = fmt_single_name(dev, &codec->id); 4022 codec->name = fmt_single_name(dev, &codec->id);
4023 if (codec->name == NULL) { 4023 if (codec->name == NULL) {
4024 kfree(codec); 4024 ret = -ENOMEM;
4025 return -ENOMEM; 4025 goto fail_codec;
4026 } 4026 }
4027 4027
4028 if (codec_drv->compress_type) 4028 if (codec_drv->compress_type)
@@ -4061,7 +4061,7 @@ int snd_soc_register_codec(struct device *dev,
4061 reg_size, GFP_KERNEL); 4061 reg_size, GFP_KERNEL);
4062 if (!codec->reg_def_copy) { 4062 if (!codec->reg_def_copy) {
4063 ret = -ENOMEM; 4063 ret = -ENOMEM;
4064 goto fail; 4064 goto fail_codec_name;
4065 } 4065 }
4066 } 4066 }
4067 } 4067 }
@@ -4085,18 +4085,22 @@ int snd_soc_register_codec(struct device *dev,
4085 mutex_unlock(&client_mutex); 4085 mutex_unlock(&client_mutex);
4086 4086
4087 /* register any DAIs */ 4087 /* register any DAIs */
4088 if (num_dai) { 4088 ret = snd_soc_register_dais(dev, dai_drv, num_dai);
4089 ret = snd_soc_register_dais(dev, dai_drv, num_dai); 4089 if (ret < 0) {
4090 if (ret < 0) 4090 dev_err(codec->dev, "ASoC: Failed to regster DAIs: %d\n", ret);
4091 dev_err(codec->dev, "ASoC: Failed to regster" 4091 goto fail_codec_name;
4092 " DAIs: %d\n", ret);
4093 } 4092 }
4094 4093
4095 dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name); 4094 dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name);
4096 return 0; 4095 return 0;
4097 4096
4098fail: 4097fail_codec_name:
4098 mutex_lock(&client_mutex);
4099 list_del(&codec->list);
4100 mutex_unlock(&client_mutex);
4101
4099 kfree(codec->name); 4102 kfree(codec->name);
4103fail_codec:
4100 kfree(codec); 4104 kfree(codec);
4101 return ret; 4105 return ret;
4102} 4106}
@@ -4110,7 +4114,6 @@ EXPORT_SYMBOL_GPL(snd_soc_register_codec);
4110void snd_soc_unregister_codec(struct device *dev) 4114void snd_soc_unregister_codec(struct device *dev)
4111{ 4115{
4112 struct snd_soc_codec *codec; 4116 struct snd_soc_codec *codec;
4113 int i;
4114 4117
4115 list_for_each_entry(codec, &codec_list, list) { 4118 list_for_each_entry(codec, &codec_list, list) {
4116 if (dev == codec->dev) 4119 if (dev == codec->dev)
@@ -4119,9 +4122,7 @@ void snd_soc_unregister_codec(struct device *dev)
4119 return; 4122 return;
4120 4123
4121found: 4124found:
4122 if (codec->num_dai) 4125 snd_soc_unregister_dais(dev, codec->num_dai);
4123 for (i = 0; i < codec->num_dai; i++)
4124 snd_soc_unregister_dai(dev);
4125 4126
4126 mutex_lock(&client_mutex); 4127 mutex_lock(&client_mutex);
4127 list_del(&codec->list); 4128 list_del(&codec->list);
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d6d9ba2e6916..33acd8b892dc 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3137,7 +3137,6 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
3137 break; 3137 break;
3138 } 3138 }
3139 3139
3140 dapm->n_widgets++;
3141 w->dapm = dapm; 3140 w->dapm = dapm;
3142 w->codec = dapm->codec; 3141 w->codec = dapm->codec;
3143 w->platform = dapm->platform; 3142 w->platform = dapm->platform;
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 29183ef2b93d..8ca9ecc5ac57 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -158,10 +158,7 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
158 return -EINVAL; 158 return -EINVAL;
159 } 159 }
160 160
161 if (IS_ERR(codec->control_data)) 161 return PTR_RET(codec->control_data);
162 return PTR_ERR(codec->control_data);
163
164 return 0;
165} 162}
166EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io); 163EXPORT_SYMBOL_GPL(snd_soc_codec_set_cache_io);
167#else 164#else