diff options
-rw-r--r-- | include/sound/soc-dapm.h | 1 | ||||
-rw-r--r-- | include/sound/soc.h | 1 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 23 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 1 |
4 files changed, 10 insertions, 16 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index e1ef63d4a5c4..d4c004929ae5 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -565,7 +565,6 @@ struct snd_soc_dapm_update { | |||
565 | 565 | ||
566 | /* DAPM context */ | 566 | /* DAPM context */ |
567 | struct snd_soc_dapm_context { | 567 | struct snd_soc_dapm_context { |
568 | int n_widgets; /* number of widgets in this context */ | ||
569 | enum snd_soc_bias_level bias_level; | 568 | enum snd_soc_bias_level bias_level; |
570 | enum snd_soc_bias_level suspend_bias_level; | 569 | enum snd_soc_bias_level suspend_bias_level; |
571 | struct delayed_work delayed_work; | 570 | struct delayed_work delayed_work; |
diff --git a/include/sound/soc.h b/include/sound/soc.h index a6a059ca3874..c84062b22221 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -1086,7 +1086,6 @@ struct soc_enum { | |||
1086 | unsigned int mask; | 1086 | unsigned int mask; |
1087 | const char * const *texts; | 1087 | const char * const *texts; |
1088 | const unsigned int *values; | 1088 | const unsigned int *values; |
1089 | void *dapm; | ||
1090 | }; | 1089 | }; |
1091 | 1090 | ||
1092 | /* codec IO */ | 1091 | /* codec IO */ |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b7e84a7cd9ee..e02c374d2243 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -4022,8 +4022,8 @@ int snd_soc_register_codec(struct device *dev, | |||
4022 | /* create CODEC component name */ | 4022 | /* create CODEC component name */ |
4023 | codec->name = fmt_single_name(dev, &codec->id); | 4023 | codec->name = fmt_single_name(dev, &codec->id); |
4024 | if (codec->name == NULL) { | 4024 | if (codec->name == NULL) { |
4025 | kfree(codec); | 4025 | ret = -ENOMEM; |
4026 | return -ENOMEM; | 4026 | goto fail_codec; |
4027 | } | 4027 | } |
4028 | 4028 | ||
4029 | if (codec_drv->compress_type) | 4029 | if (codec_drv->compress_type) |
@@ -4062,7 +4062,7 @@ int snd_soc_register_codec(struct device *dev, | |||
4062 | reg_size, GFP_KERNEL); | 4062 | reg_size, GFP_KERNEL); |
4063 | if (!codec->reg_def_copy) { | 4063 | if (!codec->reg_def_copy) { |
4064 | ret = -ENOMEM; | 4064 | ret = -ENOMEM; |
4065 | goto fail; | 4065 | goto fail_codec_name; |
4066 | } | 4066 | } |
4067 | } | 4067 | } |
4068 | } | 4068 | } |
@@ -4086,18 +4086,18 @@ int snd_soc_register_codec(struct device *dev, | |||
4086 | mutex_unlock(&client_mutex); | 4086 | mutex_unlock(&client_mutex); |
4087 | 4087 | ||
4088 | /* register any DAIs */ | 4088 | /* register any DAIs */ |
4089 | if (num_dai) { | 4089 | ret = snd_soc_register_dais(dev, dai_drv, num_dai); |
4090 | ret = snd_soc_register_dais(dev, dai_drv, num_dai); | 4090 | if (ret < 0) { |
4091 | if (ret < 0) | 4091 | dev_err(codec->dev, "ASoC: Failed to regster DAIs: %d\n", ret); |
4092 | dev_err(codec->dev, "ASoC: Failed to regster" | 4092 | goto fail_codec_name; |
4093 | " DAIs: %d\n", ret); | ||
4094 | } | 4093 | } |
4095 | 4094 | ||
4096 | dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name); | 4095 | dev_dbg(codec->dev, "ASoC: Registered codec '%s'\n", codec->name); |
4097 | return 0; | 4096 | return 0; |
4098 | 4097 | ||
4099 | fail: | 4098 | fail_codec_name: |
4100 | kfree(codec->name); | 4099 | kfree(codec->name); |
4100 | fail_codec: | ||
4101 | kfree(codec); | 4101 | kfree(codec); |
4102 | return ret; | 4102 | return ret; |
4103 | } | 4103 | } |
@@ -4111,7 +4111,6 @@ EXPORT_SYMBOL_GPL(snd_soc_register_codec); | |||
4111 | void snd_soc_unregister_codec(struct device *dev) | 4111 | void snd_soc_unregister_codec(struct device *dev) |
4112 | { | 4112 | { |
4113 | struct snd_soc_codec *codec; | 4113 | struct snd_soc_codec *codec; |
4114 | int i; | ||
4115 | 4114 | ||
4116 | list_for_each_entry(codec, &codec_list, list) { | 4115 | list_for_each_entry(codec, &codec_list, list) { |
4117 | if (dev == codec->dev) | 4116 | if (dev == codec->dev) |
@@ -4120,9 +4119,7 @@ void snd_soc_unregister_codec(struct device *dev) | |||
4120 | return; | 4119 | return; |
4121 | 4120 | ||
4122 | found: | 4121 | found: |
4123 | if (codec->num_dai) | 4122 | snd_soc_unregister_dais(dev, codec->num_dai); |
4124 | for (i = 0; i < codec->num_dai; i++) | ||
4125 | snd_soc_unregister_dai(dev); | ||
4126 | 4123 | ||
4127 | mutex_lock(&client_mutex); | 4124 | mutex_lock(&client_mutex); |
4128 | list_del(&codec->list); | 4125 | list_del(&codec->list); |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 1d6a9b3ceb27..625d4824abbb 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -3123,7 +3123,6 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, | |||
3123 | break; | 3123 | break; |
3124 | } | 3124 | } |
3125 | 3125 | ||
3126 | dapm->n_widgets++; | ||
3127 | w->dapm = dapm; | 3126 | w->dapm = dapm; |
3128 | w->codec = dapm->codec; | 3127 | w->codec = dapm->codec; |
3129 | w->platform = dapm->platform; | 3128 | w->platform = dapm->platform; |