diff options
Diffstat (limited to 'sound/soc/codecs/wm9713.c')
-rw-r--r-- | sound/soc/codecs/wm9713.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 0e60e16973d4..54db9c524988 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -1115,7 +1115,7 @@ static int wm9713_soc_suspend(struct platform_device *pdev, | |||
1115 | pm_message_t state) | 1115 | pm_message_t state) |
1116 | { | 1116 | { |
1117 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 1117 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
1118 | struct snd_soc_codec *codec = socdev->codec; | 1118 | struct snd_soc_codec *codec = socdev->card->codec; |
1119 | u16 reg; | 1119 | u16 reg; |
1120 | 1120 | ||
1121 | /* Disable everything except touchpanel - that will be handled | 1121 | /* Disable everything except touchpanel - that will be handled |
@@ -1133,7 +1133,7 @@ static int wm9713_soc_suspend(struct platform_device *pdev, | |||
1133 | static int wm9713_soc_resume(struct platform_device *pdev) | 1133 | static int wm9713_soc_resume(struct platform_device *pdev) |
1134 | { | 1134 | { |
1135 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 1135 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
1136 | struct snd_soc_codec *codec = socdev->codec; | 1136 | struct snd_soc_codec *codec = socdev->card->codec; |
1137 | struct wm9713_priv *wm9713 = codec->private_data; | 1137 | struct wm9713_priv *wm9713 = codec->private_data; |
1138 | int i, ret; | 1138 | int i, ret; |
1139 | u16 *cache = codec->reg_cache; | 1139 | u16 *cache = codec->reg_cache; |
@@ -1174,10 +1174,11 @@ static int wm9713_soc_probe(struct platform_device *pdev) | |||
1174 | 1174 | ||
1175 | printk(KERN_INFO "WM9713/WM9714 SoC Audio Codec %s\n", WM9713_VERSION); | 1175 | printk(KERN_INFO "WM9713/WM9714 SoC Audio Codec %s\n", WM9713_VERSION); |
1176 | 1176 | ||
1177 | socdev->codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL); | 1177 | socdev->card->codec = kzalloc(sizeof(struct snd_soc_codec), |
1178 | if (socdev->codec == NULL) | 1178 | GFP_KERNEL); |
1179 | if (socdev->card->codec == NULL) | ||
1179 | return -ENOMEM; | 1180 | return -ENOMEM; |
1180 | codec = socdev->codec; | 1181 | codec = socdev->card->codec; |
1181 | mutex_init(&codec->mutex); | 1182 | mutex_init(&codec->mutex); |
1182 | 1183 | ||
1183 | codec->reg_cache = kmemdup(wm9713_reg, sizeof(wm9713_reg), GFP_KERNEL); | 1184 | codec->reg_cache = kmemdup(wm9713_reg, sizeof(wm9713_reg), GFP_KERNEL); |
@@ -1249,15 +1250,15 @@ priv_err: | |||
1249 | kfree(codec->reg_cache); | 1250 | kfree(codec->reg_cache); |
1250 | 1251 | ||
1251 | cache_err: | 1252 | cache_err: |
1252 | kfree(socdev->codec); | 1253 | kfree(socdev->card->codec); |
1253 | socdev->codec = NULL; | 1254 | socdev->card->codec = NULL; |
1254 | return ret; | 1255 | return ret; |
1255 | } | 1256 | } |
1256 | 1257 | ||
1257 | static int wm9713_soc_remove(struct platform_device *pdev) | 1258 | static int wm9713_soc_remove(struct platform_device *pdev) |
1258 | { | 1259 | { |
1259 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); | 1260 | struct snd_soc_device *socdev = platform_get_drvdata(pdev); |
1260 | struct snd_soc_codec *codec = socdev->codec; | 1261 | struct snd_soc_codec *codec = socdev->card->codec; |
1261 | 1262 | ||
1262 | if (codec == NULL) | 1263 | if (codec == NULL) |
1263 | return 0; | 1264 | return 0; |