aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ad193x.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/ad193x.c')
-rw-r--r--sound/soc/codecs/ad193x.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c
index fa2834c91b9f..da46479bfcfa 100644
--- a/sound/soc/codecs/ad193x.c
+++ b/sound/soc/codecs/ad193x.c
@@ -19,12 +19,10 @@
19#include <sound/initval.h> 19#include <sound/initval.h>
20#include <sound/soc.h> 20#include <sound/soc.h>
21#include <sound/tlv.h> 21#include <sound/tlv.h>
22#include <sound/soc-dapm.h>
23#include "ad193x.h" 22#include "ad193x.h"
24 23
25/* codec private data */ 24/* codec private data */
26struct ad193x_priv { 25struct ad193x_priv {
27 u8 reg_cache[AD193X_NUM_REGS];
28 enum snd_soc_control_type bus_type; 26 enum snd_soc_control_type bus_type;
29 void *control_data; 27 void *control_data;
30 int sysclk; 28 int sysclk;
@@ -353,6 +351,7 @@ static struct snd_soc_dai_driver ad193x_dai = {
353static int ad193x_probe(struct snd_soc_codec *codec) 351static int ad193x_probe(struct snd_soc_codec *codec)
354{ 352{
355 struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec); 353 struct ad193x_priv *ad193x = snd_soc_codec_get_drvdata(codec);
354 struct snd_soc_dapm_context *dapm = &codec->dapm;
356 int ret; 355 int ret;
357 356
358 codec->control_data = ad193x->control_data; 357 codec->control_data = ad193x->control_data;
@@ -363,7 +362,6 @@ static int ad193x_probe(struct snd_soc_codec *codec)
363 if (ret < 0) { 362 if (ret < 0) {
364 dev_err(codec->dev, "failed to set cache I/O: %d\n", 363 dev_err(codec->dev, "failed to set cache I/O: %d\n",
365 ret); 364 ret);
366 kfree(ad193x);
367 return ret; 365 return ret;
368 } 366 }
369 367
@@ -385,9 +383,9 @@ static int ad193x_probe(struct snd_soc_codec *codec)
385 383
386 snd_soc_add_controls(codec, ad193x_snd_controls, 384 snd_soc_add_controls(codec, ad193x_snd_controls,
387 ARRAY_SIZE(ad193x_snd_controls)); 385 ARRAY_SIZE(ad193x_snd_controls));
388 snd_soc_dapm_new_controls(codec, ad193x_dapm_widgets, 386 snd_soc_dapm_new_controls(dapm, ad193x_dapm_widgets,
389 ARRAY_SIZE(ad193x_dapm_widgets)); 387 ARRAY_SIZE(ad193x_dapm_widgets));
390 snd_soc_dapm_add_routes(codec, audio_paths, ARRAY_SIZE(audio_paths)); 388 snd_soc_dapm_add_routes(dapm, audio_paths, ARRAY_SIZE(audio_paths));
391 389
392 return ret; 390 return ret;
393} 391}