aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/max98088.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-rw-r--r--sound/soc/codecs/max98088.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index ebbf63c79c34..006efcfe6dda 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.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>
@@ -1650,14 +1649,14 @@ static int max98088_set_bias_level(struct snd_soc_codec *codec,
1650#define MAX98088_RATES SNDRV_PCM_RATE_8000_96000 1649#define MAX98088_RATES SNDRV_PCM_RATE_8000_96000
1651#define MAX98088_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) 1650#define MAX98088_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
1652 1651
1653static struct snd_soc_dai_ops max98088_dai1_ops = { 1652static const struct snd_soc_dai_ops max98088_dai1_ops = {
1654 .set_sysclk = max98088_dai_set_sysclk, 1653 .set_sysclk = max98088_dai_set_sysclk,
1655 .set_fmt = max98088_dai1_set_fmt, 1654 .set_fmt = max98088_dai1_set_fmt,
1656 .hw_params = max98088_dai1_hw_params, 1655 .hw_params = max98088_dai1_hw_params,
1657 .digital_mute = max98088_dai1_digital_mute, 1656 .digital_mute = max98088_dai1_digital_mute,
1658}; 1657};
1659 1658
1660static struct snd_soc_dai_ops max98088_dai2_ops = { 1659static const struct snd_soc_dai_ops max98088_dai2_ops = {
1661 .set_sysclk = max98088_dai_set_sysclk, 1660 .set_sysclk = max98088_dai_set_sysclk,
1662 .set_fmt = max98088_dai2_set_fmt, 1661 .set_fmt = max98088_dai2_set_fmt,
1663 .hw_params = max98088_dai2_hw_params, 1662 .hw_params = max98088_dai2_hw_params,
@@ -1947,7 +1946,7 @@ static void max98088_handle_pdata(struct snd_soc_codec *codec)
1947} 1946}
1948 1947
1949#ifdef CONFIG_PM 1948#ifdef CONFIG_PM
1950static int max98088_suspend(struct snd_soc_codec *codec, pm_message_t state) 1949static int max98088_suspend(struct snd_soc_codec *codec)
1951{ 1950{
1952 max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); 1951 max98088_set_bias_level(codec, SND_SOC_BIAS_OFF);
1953 1952
@@ -2070,7 +2069,8 @@ static int max98088_i2c_probe(struct i2c_client *i2c,
2070 struct max98088_priv *max98088; 2069 struct max98088_priv *max98088;
2071 int ret; 2070 int ret;
2072 2071
2073 max98088 = kzalloc(sizeof(struct max98088_priv), GFP_KERNEL); 2072 max98088 = devm_kzalloc(&i2c->dev, sizeof(struct max98088_priv),
2073 GFP_KERNEL);
2074 if (max98088 == NULL) 2074 if (max98088 == NULL)
2075 return -ENOMEM; 2075 return -ENOMEM;
2076 2076
@@ -2081,15 +2081,12 @@ static int max98088_i2c_probe(struct i2c_client *i2c,
2081 2081
2082 ret = snd_soc_register_codec(&i2c->dev, 2082 ret = snd_soc_register_codec(&i2c->dev,
2083 &soc_codec_dev_max98088, &max98088_dai[0], 2); 2083 &soc_codec_dev_max98088, &max98088_dai[0], 2);
2084 if (ret < 0)
2085 kfree(max98088);
2086 return ret; 2084 return ret;
2087} 2085}
2088 2086
2089static int __devexit max98088_i2c_remove(struct i2c_client *client) 2087static int __devexit max98088_i2c_remove(struct i2c_client *client)
2090{ 2088{
2091 snd_soc_unregister_codec(&client->dev); 2089 snd_soc_unregister_codec(&client->dev);
2092 kfree(i2c_get_clientdata(client));
2093 return 0; 2090 return 0;
2094} 2091}
2095 2092