diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 15:00:22 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 15:00:22 +0000 |
commit | 4de3a8e101150feaefa1139611a50ff37467f33e (patch) | |
tree | daada742542518b02d7db7c5d32e715eaa5f166d /sound/soc/codecs/max98095.c | |
parent | 294064f58953f9964e5945424b09c51800330a83 (diff) | |
parent | 099469502f62fbe0d7e4f0b83a2f22538367f734 (diff) | |
download | blackbird-op-linux-4de3a8e101150feaefa1139611a50ff37467f33e.tar.gz blackbird-op-linux-4de3a8e101150feaefa1139611a50ff37467f33e.zip |
Merge branch 'master' into fixes
Diffstat (limited to 'sound/soc/codecs/max98095.c')
-rw-r--r-- | sound/soc/codecs/max98095.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 26d7b089fb9c..fcfa7497d7b7 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -15,7 +15,6 @@ #include <linux/delay.h> #include <linux/pm.h> #include <linux/i2c.h> -#include <linux/platform_device.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> @@ -1782,19 +1781,19 @@ static int max98095_set_bias_level(struct snd_soc_codec *codec, #define MAX98095_RATES SNDRV_PCM_RATE_8000_96000 #define MAX98095_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) -static struct snd_soc_dai_ops max98095_dai1_ops = { +static const struct snd_soc_dai_ops max98095_dai1_ops = { .set_sysclk = max98095_dai_set_sysclk, .set_fmt = max98095_dai1_set_fmt, .hw_params = max98095_dai1_hw_params, }; -static struct snd_soc_dai_ops max98095_dai2_ops = { +static const struct snd_soc_dai_ops max98095_dai2_ops = { .set_sysclk = max98095_dai_set_sysclk, .set_fmt = max98095_dai2_set_fmt, .hw_params = max98095_dai2_hw_params, }; -static struct snd_soc_dai_ops max98095_dai3_ops = { +static const struct snd_soc_dai_ops max98095_dai3_ops = { .set_sysclk = max98095_dai_set_sysclk, .set_fmt = max98095_dai3_set_fmt, .hw_params = max98095_dai3_hw_params, @@ -2175,7 +2174,7 @@ static void max98095_handle_pdata(struct snd_soc_codec *codec) } #ifdef CONFIG_PM -static int max98095_suspend(struct snd_soc_codec *codec, pm_message_t state) +static int max98095_suspend(struct snd_soc_codec *codec) { max98095_set_bias_level(codec, SND_SOC_BIAS_OFF); @@ -2341,7 +2340,8 @@ static int max98095_i2c_probe(struct i2c_client *i2c, struct max98095_priv *max98095; int ret; - max98095 = kzalloc(sizeof(struct max98095_priv), GFP_KERNEL); + max98095 = devm_kzalloc(&i2c->dev, sizeof(struct max98095_priv), + GFP_KERNEL); if (max98095 == NULL) return -ENOMEM; @@ -2351,16 +2351,12 @@ static int max98095_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_max98095, max98095_dai, ARRAY_SIZE(max98095_dai)); - if (ret < 0) - kfree(max98095); return ret; } static int __devexit max98095_i2c_remove(struct i2c_client *client) { snd_soc_unregister_codec(&client->dev); - kfree(i2c_get_clientdata(client)); - return 0; } |