diff options
Diffstat (limited to 'sound/soc/codecs/ad1836.c')
-rw-r--r-- | sound/soc/codecs/ad1836.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c index 4e5c5726366..982d201c2e8 100644 --- a/sound/soc/codecs/ad1836.c +++ b/sound/soc/codecs/ad1836.c | |||
@@ -189,7 +189,7 @@ static int ad1836_hw_params(struct snd_pcm_substream *substream, | |||
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
191 | 191 | ||
192 | static struct snd_soc_dai_ops ad1836_dai_ops = { | 192 | static const struct snd_soc_dai_ops ad1836_dai_ops = { |
193 | .hw_params = ad1836_hw_params, | 193 | .hw_params = ad1836_hw_params, |
194 | .set_fmt = ad1836_set_dai_fmt, | 194 | .set_fmt = ad1836_set_dai_fmt, |
195 | }; | 195 | }; |
@@ -223,7 +223,7 @@ static struct snd_soc_dai_driver ad183x_dais[] = { | |||
223 | }; | 223 | }; |
224 | 224 | ||
225 | #ifdef CONFIG_PM | 225 | #ifdef CONFIG_PM |
226 | static int ad1836_suspend(struct snd_soc_codec *codec, pm_message_t state) | 226 | static int ad1836_suspend(struct snd_soc_codec *codec) |
227 | { | 227 | { |
228 | /* reset clock control mode */ | 228 | /* reset clock control mode */ |
229 | return snd_soc_update_bits(codec, AD1836_ADC_CTRL2, | 229 | return snd_soc_update_bits(codec, AD1836_ADC_CTRL2, |
@@ -341,7 +341,8 @@ static int __devinit ad1836_spi_probe(struct spi_device *spi) | |||
341 | struct ad1836_priv *ad1836; | 341 | struct ad1836_priv *ad1836; |
342 | int ret; | 342 | int ret; |
343 | 343 | ||
344 | ad1836 = kzalloc(sizeof(struct ad1836_priv), GFP_KERNEL); | 344 | ad1836 = devm_kzalloc(&spi->dev, sizeof(struct ad1836_priv), |
345 | GFP_KERNEL); | ||
345 | if (ad1836 == NULL) | 346 | if (ad1836 == NULL) |
346 | return -ENOMEM; | 347 | return -ENOMEM; |
347 | 348 | ||
@@ -351,17 +352,15 @@ static int __devinit ad1836_spi_probe(struct spi_device *spi) | |||
351 | 352 | ||
352 | ret = snd_soc_register_codec(&spi->dev, | 353 | ret = snd_soc_register_codec(&spi->dev, |
353 | &soc_codec_dev_ad1836, &ad183x_dais[ad1836->type], 1); | 354 | &soc_codec_dev_ad1836, &ad183x_dais[ad1836->type], 1); |
354 | if (ret < 0) | ||
355 | kfree(ad1836); | ||
356 | return ret; | 355 | return ret; |
357 | } | 356 | } |
358 | 357 | ||
359 | static int __devexit ad1836_spi_remove(struct spi_device *spi) | 358 | static int __devexit ad1836_spi_remove(struct spi_device *spi) |
360 | { | 359 | { |
361 | snd_soc_unregister_codec(&spi->dev); | 360 | snd_soc_unregister_codec(&spi->dev); |
362 | kfree(spi_get_drvdata(spi)); | ||
363 | return 0; | 361 | return 0; |
364 | } | 362 | } |
363 | |||
365 | static const struct spi_device_id ad1836_ids[] = { | 364 | static const struct spi_device_id ad1836_ids[] = { |
366 | { "ad1835", AD1835 }, | 365 | { "ad1835", AD1835 }, |
367 | { "ad1836", AD1836 }, | 366 | { "ad1836", AD1836 }, |