diff options
Diffstat (limited to 'sound/soc/codecs/tlv320aic26.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic26.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index 7859bdcc93db..a038daec682b 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c | |||
@@ -275,7 +275,7 @@ static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
275 | #define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\ | 275 | #define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\ |
276 | SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE) | 276 | SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE) |
277 | 277 | ||
278 | static struct snd_soc_dai_ops aic26_dai_ops = { | 278 | static const struct snd_soc_dai_ops aic26_dai_ops = { |
279 | .hw_params = aic26_hw_params, | 279 | .hw_params = aic26_hw_params, |
280 | .digital_mute = aic26_mute, | 280 | .digital_mute = aic26_mute, |
281 | .set_sysclk = aic26_set_sysclk, | 281 | .set_sysclk = aic26_set_sysclk, |
@@ -416,7 +416,7 @@ static int aic26_spi_probe(struct spi_device *spi) | |||
416 | dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n"); | 416 | dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n"); |
417 | 417 | ||
418 | /* Allocate driver data */ | 418 | /* Allocate driver data */ |
419 | aic26 = kzalloc(sizeof *aic26, GFP_KERNEL); | 419 | aic26 = devm_kzalloc(&spi->dev, sizeof *aic26, GFP_KERNEL); |
420 | if (!aic26) | 420 | if (!aic26) |
421 | return -ENOMEM; | 421 | return -ENOMEM; |
422 | 422 | ||
@@ -427,18 +427,12 @@ static int aic26_spi_probe(struct spi_device *spi) | |||
427 | 427 | ||
428 | ret = snd_soc_register_codec(&spi->dev, | 428 | ret = snd_soc_register_codec(&spi->dev, |
429 | &aic26_soc_codec_dev, &aic26_dai, 1); | 429 | &aic26_soc_codec_dev, &aic26_dai, 1); |
430 | if (ret < 0) | ||
431 | kfree(aic26); | ||
432 | return ret; | 430 | return ret; |
433 | |||
434 | dev_dbg(&spi->dev, "SPI device initialized\n"); | ||
435 | return 0; | ||
436 | } | 431 | } |
437 | 432 | ||
438 | static int aic26_spi_remove(struct spi_device *spi) | 433 | static int aic26_spi_remove(struct spi_device *spi) |
439 | { | 434 | { |
440 | snd_soc_unregister_codec(&spi->dev); | 435 | snd_soc_unregister_codec(&spi->dev); |
441 | kfree(spi_get_drvdata(spi)); | ||
442 | return 0; | 436 | return 0; |
443 | } | 437 | } |
444 | 438 | ||