Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47198
b: refs/heads/master
c: e35115a
h: refs/heads/master
v: v3
  • Loading branch information
Liam Girdwood authored and Jaroslav Kysela committed Feb 9, 2007
1 parent 62f8cb2 commit 0ab7c2c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 877b866d86786ac69d3d939905999fe7fe1e23fd
refs/heads/master: e35115a58856ced315cb8f75df56e9b9a816e70a
15 changes: 11 additions & 4 deletions trunk/sound/soc/codecs/wm8731.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,8 @@ static int wm8731_init(struct snd_soc_device *socdev)
/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0) {
kfree(codec->reg_cache);
return ret;
printk(KERN_ERR "wm8731: failed to create pcms\n");
goto pcm_err;
}

/* power on device */
Expand All @@ -717,11 +717,18 @@ static int wm8731_init(struct snd_soc_device *socdev)
wm8731_add_widgets(codec);
ret = snd_soc_register_card(socdev);
if (ret < 0) {
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
printk(KERN_ERR "wm8731: failed to register card\n");
goto card_err;
}

return ret;

card_err:
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
pcm_err:
kfree(codec->reg_cache);
return ret;
}

static struct snd_soc_device *wm8731_socdev;
Expand Down
14 changes: 10 additions & 4 deletions trunk/sound/soc/codecs/wm8750.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,8 +1075,8 @@ static int wm8750_init(struct snd_soc_device *socdev)
/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0) {
kfree(codec->reg_cache);
return ret;
printk(KERN_ERR "wm8750: failed to create pcms\n");
goto pcm_err;
}

/* charge output caps */
Expand Down Expand Up @@ -1106,10 +1106,16 @@ static int wm8750_init(struct snd_soc_device *socdev)
wm8750_add_widgets(codec);
ret = snd_soc_register_card(socdev);
if (ret < 0) {
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
printk(KERN_ERR "wm8750: failed to register card\n");
goto card_err;
}
return ret;

card_err:
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
pcm_err:
kfree(codec->reg_cache);
return ret;
}

Expand Down
22 changes: 13 additions & 9 deletions trunk/sound/soc/codecs/wm9712.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,8 @@ static int wm9712_soc_probe(struct platform_device *pdev)
codec->reg_cache =
kzalloc(sizeof(u16) * ARRAY_SIZE(wm9712_reg), GFP_KERNEL);
if (codec->reg_cache == NULL) {
kfree(codec->ac97);
kfree(socdev->codec);
socdev->codec = NULL;
return -ENOMEM;
ret = -ENOMEM;
goto cache_err;
}
memcpy(codec->reg_cache, wm9712_reg, sizeof(u16) * ARRAY_SIZE(wm9712_reg));
codec->reg_cache_size = sizeof(u16) * ARRAY_SIZE(wm9712_reg);
Expand All @@ -712,8 +710,10 @@ static int wm9712_soc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&codec->dapm_paths);

ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
if (ret < 0)
goto err;
if (ret < 0) {
printk(KERN_ERR "wm9712: failed to register AC97 codec\n");
goto codec_err;
}

/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
Expand All @@ -733,8 +733,10 @@ static int wm9712_soc_probe(struct platform_device *pdev)
wm9712_add_controls(codec);
wm9712_add_widgets(codec);
ret = snd_soc_register_card(socdev);
if (ret < 0)
if (ret < 0) {
printk(KERN_ERR "wm9712: failed to register card\n");
goto reset_err;
}

return 0;

Expand All @@ -744,8 +746,10 @@ static int wm9712_soc_probe(struct platform_device *pdev)
pcm_err:
snd_soc_free_ac97_codec(codec);

err:
kfree(socdev->codec->reg_cache);
codec_err:
kfree(codec->reg_cache);

cache_err:
kfree(socdev->codec);
socdev->codec = NULL;
return ret;
Expand Down

0 comments on commit 0ab7c2c

Please sign in to comment.