aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/max98095.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/max98095.c')
-rw-r--r--sound/soc/codecs/max98095.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index 26d7b089fb9..fcfa7497d7b 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -15,7 +15,6 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/pm.h> 16#include <linux/pm.h>
17#include <linux/i2c.h> 17#include <linux/i2c.h>
18#include <linux/platform_device.h>
19#include <sound/core.h> 18#include <sound/core.h>
20#include <sound/pcm.h> 19#include <sound/pcm.h>
21#include <sound/pcm_params.h> 20#include <sound/pcm_params.h>
@@ -1782,19 +1781,19 @@ static int max98095_set_bias_level(struct snd_soc_codec *codec,
1782#define MAX98095_RATES SNDRV_PCM_RATE_8000_96000 1781#define MAX98095_RATES SNDRV_PCM_RATE_8000_96000
1783#define MAX98095_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) 1782#define MAX98095_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
1784 1783
1785static struct snd_soc_dai_ops max98095_dai1_ops = { 1784static const struct snd_soc_dai_ops max98095_dai1_ops = {
1786 .set_sysclk = max98095_dai_set_sysclk, 1785 .set_sysclk = max98095_dai_set_sysclk,
1787 .set_fmt = max98095_dai1_set_fmt, 1786 .set_fmt = max98095_dai1_set_fmt,
1788 .hw_params = max98095_dai1_hw_params, 1787 .hw_params = max98095_dai1_hw_params,
1789}; 1788};
1790 1789
1791static struct snd_soc_dai_ops max98095_dai2_ops = { 1790static const struct snd_soc_dai_ops max98095_dai2_ops = {
1792 .set_sysclk = max98095_dai_set_sysclk, 1791 .set_sysclk = max98095_dai_set_sysclk,
1793 .set_fmt = max98095_dai2_set_fmt, 1792 .set_fmt = max98095_dai2_set_fmt,
1794 .hw_params = max98095_dai2_hw_params, 1793 .hw_params = max98095_dai2_hw_params,
1795}; 1794};
1796 1795
1797static struct snd_soc_dai_ops max98095_dai3_ops = { 1796static const struct snd_soc_dai_ops max98095_dai3_ops = {
1798 .set_sysclk = max98095_dai_set_sysclk, 1797 .set_sysclk = max98095_dai_set_sysclk,
1799 .set_fmt = max98095_dai3_set_fmt, 1798 .set_fmt = max98095_dai3_set_fmt,
1800 .hw_params = max98095_dai3_hw_params, 1799 .hw_params = max98095_dai3_hw_params,
@@ -2175,7 +2174,7 @@ static void max98095_handle_pdata(struct snd_soc_codec *codec)
2175} 2174}
2176 2175
2177#ifdef CONFIG_PM 2176#ifdef CONFIG_PM
2178static int max98095_suspend(struct snd_soc_codec *codec, pm_message_t state) 2177static int max98095_suspend(struct snd_soc_codec *codec)
2179{ 2178{
2180 max98095_set_bias_level(codec, SND_SOC_BIAS_OFF); 2179 max98095_set_bias_level(codec, SND_SOC_BIAS_OFF);
2181 2180
@@ -2341,7 +2340,8 @@ static int max98095_i2c_probe(struct i2c_client *i2c,
2341 struct max98095_priv *max98095; 2340 struct max98095_priv *max98095;
2342 int ret; 2341 int ret;
2343 2342
2344 max98095 = kzalloc(sizeof(struct max98095_priv), GFP_KERNEL); 2343 max98095 = devm_kzalloc(&i2c->dev, sizeof(struct max98095_priv),
2344 GFP_KERNEL);
2345 if (max98095 == NULL) 2345 if (max98095 == NULL)
2346 return -ENOMEM; 2346 return -ENOMEM;
2347 2347
@@ -2351,16 +2351,12 @@ static int max98095_i2c_probe(struct i2c_client *i2c,
2351 2351
2352 ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_max98095, 2352 ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_max98095,
2353 max98095_dai, ARRAY_SIZE(max98095_dai)); 2353 max98095_dai, ARRAY_SIZE(max98095_dai));
2354 if (ret < 0)
2355 kfree(max98095);
2356 return ret; 2354 return ret;
2357} 2355}
2358 2356
2359static int __devexit max98095_i2c_remove(struct i2c_client *client) 2357static int __devexit max98095_i2c_remove(struct i2c_client *client)
2360{ 2358{
2361 snd_soc_unregister_codec(&client->dev); 2359 snd_soc_unregister_codec(&client->dev);
2362 kfree(i2c_get_clientdata(client));
2363
2364 return 0; 2360 return 0;
2365} 2361}
2366 2362