aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/sta32x.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 3d155f526672..5c7def3979c0 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -812,6 +812,7 @@ static int sta32x_remove(struct snd_soc_codec *codec)
812{ 812{
813 struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec); 813 struct sta32x_priv *sta32x = snd_soc_codec_get_drvdata(codec);
814 814
815 sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF);
815 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); 816 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
816 regulator_bulk_free(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); 817 regulator_bulk_free(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
817 818
@@ -871,18 +872,8 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c,
871static __devexit int sta32x_i2c_remove(struct i2c_client *client) 872static __devexit int sta32x_i2c_remove(struct i2c_client *client)
872{ 873{
873 struct sta32x_priv *sta32x = i2c_get_clientdata(client); 874 struct sta32x_priv *sta32x = i2c_get_clientdata(client);
874 struct snd_soc_codec *codec = sta32x->codec;
875
876 if (codec)
877 sta32x_set_bias_level(codec, SND_SOC_BIAS_OFF);
878
879 regulator_bulk_free(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
880
881 if (codec) {
882 snd_soc_unregister_codec(&client->dev);
883 snd_soc_codec_set_drvdata(codec, NULL);
884 }
885 875
876 snd_soc_unregister_codec(&client->dev);
886 kfree(sta32x); 877 kfree(sta32x);
887 return 0; 878 return 0;
888} 879}