diff options
Diffstat (limited to 'sound/soc/codecs/rt5631.c')
-rw-r--r-- | sound/soc/codecs/rt5631.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/codecs/rt5631.c b/sound/soc/codecs/rt5631.c index 4646e808b90a..20c324c7c349 100644 --- a/sound/soc/codecs/rt5631.c +++ b/sound/soc/codecs/rt5631.c @@ -18,7 +18,6 @@ #include <linux/delay.h> #include <linux/pm.h> #include <linux/i2c.h> -#include <linux/platform_device.h> #include <linux/spi/spi.h> #include <sound/core.h> #include <sound/pcm.h> @@ -1642,7 +1641,7 @@ static int rt5631_remove(struct snd_soc_codec *codec) } #ifdef CONFIG_PM -static int rt5631_suspend(struct snd_soc_codec *codec, pm_message_t state) +static int rt5631_suspend(struct snd_soc_codec *codec) { rt5631_set_bias_level(codec, SND_SOC_BIAS_OFF); return 0; @@ -1664,7 +1663,7 @@ static int rt5631_resume(struct snd_soc_codec *codec) SNDRV_PCM_FMTBIT_S24_LE | \ SNDRV_PCM_FMTBIT_S8) -static struct snd_soc_dai_ops rt5631_ops = { +static const struct snd_soc_dai_ops rt5631_ops = { .hw_params = rt5631_hifi_pcm_params, .set_fmt = rt5631_hifi_codec_set_dai_fmt, .set_sysclk = rt5631_hifi_codec_set_dai_sysclk, @@ -1725,7 +1724,8 @@ static int rt5631_i2c_probe(struct i2c_client *i2c, struct rt5631_priv *rt5631; int ret; - rt5631 = kzalloc(sizeof(struct rt5631_priv), GFP_KERNEL); + rt5631 = devm_kzalloc(&i2c->dev, sizeof(struct rt5631_priv), + GFP_KERNEL); if (NULL == rt5631) return -ENOMEM; @@ -1733,16 +1733,12 @@ static int rt5631_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5631, rt5631_dai, ARRAY_SIZE(rt5631_dai)); - if (ret < 0) - kfree(rt5631); - return ret; } static __devexit int rt5631_i2c_remove(struct i2c_client *client) { snd_soc_unregister_codec(&client->dev); - kfree(i2c_get_clientdata(client)); return 0; } |