X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=sound%2Fsoc%2Fcodecs%2Fmax98095.c;h=fcfa7497d7b74aac4777def9e7b7d186ec7c58ef;hb=c63dbbd5268c397f051e0e0f665799ef64a1f3a4;hp=26d7b089fb9c27836c2a6721dceec1350bc5300f;hpb=b4949b84567f3ae1227d076fc95bbd8efea06506;p=karo-tx-linux.git 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 #include #include -#include #include #include #include @@ -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; }