aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ak4535.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/ak4535.c')
-rw-r--r--sound/soc/codecs/ak4535.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index 95d782d86e7d..9e809e05d066 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -18,7 +18,6 @@
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/pm.h> 19#include <linux/pm.h>
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21#include <linux/platform_device.h>
22#include <linux/slab.h> 21#include <linux/slab.h>
23#include <sound/core.h> 22#include <sound/core.h>
24#include <sound/pcm.h> 23#include <sound/pcm.h>
@@ -331,7 +330,7 @@ static int ak4535_set_bias_level(struct snd_soc_codec *codec,
331 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\ 330 SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 |\
332 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) 331 SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
333 332
334static struct snd_soc_dai_ops ak4535_dai_ops = { 333static const struct snd_soc_dai_ops ak4535_dai_ops = {
335 .hw_params = ak4535_hw_params, 334 .hw_params = ak4535_hw_params,
336 .set_fmt = ak4535_set_dai_fmt, 335 .set_fmt = ak4535_set_dai_fmt,
337 .digital_mute = ak4535_mute, 336 .digital_mute = ak4535_mute,
@@ -355,7 +354,7 @@ static struct snd_soc_dai_driver ak4535_dai = {
355 .ops = &ak4535_dai_ops, 354 .ops = &ak4535_dai_ops,
356}; 355};
357 356
358static int ak4535_suspend(struct snd_soc_codec *codec, pm_message_t state) 357static int ak4535_suspend(struct snd_soc_codec *codec)
359{ 358{
360 ak4535_set_bias_level(codec, SND_SOC_BIAS_OFF); 359 ak4535_set_bias_level(codec, SND_SOC_BIAS_OFF);
361 return 0; 360 return 0;
@@ -417,7 +416,8 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c,
417 struct ak4535_priv *ak4535; 416 struct ak4535_priv *ak4535;
418 int ret; 417 int ret;
419 418
420 ak4535 = kzalloc(sizeof(struct ak4535_priv), GFP_KERNEL); 419 ak4535 = devm_kzalloc(&i2c->dev, sizeof(struct ak4535_priv),
420 GFP_KERNEL);
421 if (ak4535 == NULL) 421 if (ak4535 == NULL)
422 return -ENOMEM; 422 return -ENOMEM;
423 423
@@ -426,15 +426,12 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c,
426 426
427 ret = snd_soc_register_codec(&i2c->dev, 427 ret = snd_soc_register_codec(&i2c->dev,
428 &soc_codec_dev_ak4535, &ak4535_dai, 1); 428 &soc_codec_dev_ak4535, &ak4535_dai, 1);
429 if (ret < 0)
430 kfree(ak4535);
431 return ret; 429 return ret;
432} 430}
433 431
434static __devexit int ak4535_i2c_remove(struct i2c_client *client) 432static __devexit int ak4535_i2c_remove(struct i2c_client *client)
435{ 433{
436 snd_soc_unregister_codec(&client->dev); 434 snd_soc_unregister_codec(&client->dev);
437 kfree(i2c_get_clientdata(client));
438 return 0; 435 return 0;
439} 436}
440 437