diff options
Diffstat (limited to 'sound/soc/davinci/davinci-vcif.c')
-rw-r--r-- | sound/soc/davinci/davinci-vcif.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c index 1f11525d97e..da030ff883d 100644 --- a/sound/soc/davinci/davinci-vcif.c +++ b/sound/soc/davinci/davinci-vcif.c @@ -183,7 +183,7 @@ static int davinci_vcif_startup(struct snd_pcm_substream *substream, #define DAVINCI_VCIF_RATES SNDRV_PCM_RATE_8000_48000 -static struct snd_soc_dai_ops davinci_vcif_dai_ops = { +static const struct snd_soc_dai_ops davinci_vcif_dai_ops = { .startup = davinci_vcif_startup, .trigger = davinci_vcif_trigger, .hw_params = davinci_vcif_hw_params, @@ -210,7 +210,9 @@ static int davinci_vcif_probe(struct platform_device *pdev) struct davinci_vcif_dev *davinci_vcif_dev; int ret; - davinci_vcif_dev = kzalloc(sizeof(struct davinci_vcif_dev), GFP_KERNEL); + davinci_vcif_dev = devm_kzalloc(&pdev->dev, + sizeof(struct davinci_vcif_dev), + GFP_KERNEL); if (!davinci_vcif_dev) { dev_dbg(&pdev->dev, "could not allocate memory for private data\n"); @@ -235,23 +237,15 @@ static int davinci_vcif_probe(struct platform_device *pdev) ret = snd_soc_register_dai(&pdev->dev, &davinci_vcif_dai); if (ret != 0) { dev_err(&pdev->dev, "could not register dai\n"); - goto fail; + return ret; } return 0; - -fail: - kfree(davinci_vcif_dev); - - return ret; } static int davinci_vcif_remove(struct platform_device *pdev) { - struct davinci_vcif_dev *davinci_vcif_dev = dev_get_drvdata(&pdev->dev); - snd_soc_unregister_dai(&pdev->dev); - kfree(davinci_vcif_dev); return 0; } @@ -265,17 +259,7 @@ static struct platform_driver davinci_vcif_driver = { }, }; -static int __init davinci_vcif_init(void) -{ - return platform_driver_probe(&davinci_vcif_driver, davinci_vcif_probe); -} -module_init(davinci_vcif_init); - -static void __exit davinci_vcif_exit(void) -{ - platform_driver_unregister(&davinci_vcif_driver); -} -module_exit(davinci_vcif_exit); +module_platform_driver(davinci_vcif_driver); MODULE_AUTHOR("Miguel Aguilar"); MODULE_DESCRIPTION("Texas Instruments DaVinci ASoC Voice Codec Interface"); |