Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206645
b: refs/heads/master
c: d484366
h: refs/heads/master
i:
  206643: eeade61
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 3, 2010
1 parent bc5e861 commit b2e6059
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: 4eaac50552395f693b8c428872e8b5311c3dab60
refs/heads/master: d484366beeab0cded9644083172151c5afacc503
10 changes: 7 additions & 3 deletions trunk/sound/soc/codecs/wm8978.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,6 @@ static __devinit int wm8978_register(struct wm8978_priv *wm8978)
err_codec:
snd_soc_unregister_codec(codec);
err:
kfree(wm8978);
return ret;
}

Expand All @@ -1085,13 +1084,13 @@ static __devexit void wm8978_unregister(struct wm8978_priv *wm8978)
wm8978_set_bias_level(&wm8978->codec, SND_SOC_BIAS_OFF);
snd_soc_unregister_dai(&wm8978_dai);
snd_soc_unregister_codec(&wm8978->codec);
kfree(wm8978);
wm8978_codec = NULL;
}

static __devinit int wm8978_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
int ret;
struct wm8978_priv *wm8978;
struct snd_soc_codec *codec;

Expand All @@ -1107,13 +1106,18 @@ static __devinit int wm8978_i2c_probe(struct i2c_client *i2c,

codec->dev = &i2c->dev;

return wm8978_register(wm8978);
ret = wm8978_register(wm8978);
if (ret < 0)
kfree(wm8978);

return ret;
}

static __devexit int wm8978_i2c_remove(struct i2c_client *client)
{
struct wm8978_priv *wm8978 = i2c_get_clientdata(client);
wm8978_unregister(wm8978);
kfree(wm8978);
return 0;
}

Expand Down

0 comments on commit b2e6059

Please sign in to comment.