aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/eukrea-tlv320.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/fsl/eukrea-tlv320.c')
-rw-r--r--sound/soc/fsl/eukrea-tlv320.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c
index efb9ede01208..267d5b4b63ce 100644
--- a/sound/soc/fsl/eukrea-tlv320.c
+++ b/sound/soc/fsl/eukrea-tlv320.c
@@ -93,9 +93,7 @@ static struct snd_soc_card eukrea_tlv320 = {
93 .num_links = 1, 93 .num_links = 1,
94}; 94};
95 95
96static struct platform_device *eukrea_tlv320_snd_device; 96static int __devinit eukrea_tlv320_probe(struct platform_device *pdev)
97
98static int __init eukrea_tlv320_init(void)
99{ 97{
100 int ret; 98 int ret;
101 int int_port = 0, ext_port; 99 int int_port = 0, ext_port;
@@ -136,29 +134,32 @@ static int __init eukrea_tlv320_init(void)
136 return 0; 134 return 0;
137 } 135 }
138 136
139 eukrea_tlv320_snd_device = platform_device_alloc("soc-audio", -1); 137 eukrea_tlv320.dev = &pdev->dev;
140 if (!eukrea_tlv320_snd_device) 138 ret = snd_soc_register_card(&eukrea_tlv320);
141 return -ENOMEM; 139 if (ret)
142 140 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
143 platform_set_drvdata(eukrea_tlv320_snd_device, &eukrea_tlv320);
144 ret = platform_device_add(eukrea_tlv320_snd_device);
145
146 if (ret) {
147 printk(KERN_ERR "ASoC: Platform device allocation failed\n");
148 platform_device_put(eukrea_tlv320_snd_device);
149 }
150 141
151 return ret; 142 return ret;
152} 143}
153 144
154static void __exit eukrea_tlv320_exit(void) 145static int __devexit eukrea_tlv320_remove(struct platform_device *pdev)
155{ 146{
156 platform_device_unregister(eukrea_tlv320_snd_device); 147 snd_soc_unregister_card(&eukrea_tlv320);
148
149 return 0;
157} 150}
158 151
159module_init(eukrea_tlv320_init); 152static struct platform_driver eukrea_tlv320_driver = {
160module_exit(eukrea_tlv320_exit); 153 .driver = {
154 .name = "eukrea_tlv320",
155 .owner = THIS_MODULE,
156 },
157 .probe = eukrea_tlv320_probe,
158 .remove = __devexit_p(eukrea_tlv320_remove),};
159
160module_platform_driver(eukrea_tlv320_driver);
161 161
162MODULE_AUTHOR("Eric Bénard <eric@eukrea.com>"); 162MODULE_AUTHOR("Eric Bénard <eric@eukrea.com>");
163MODULE_DESCRIPTION("CPUIMX ALSA SoC driver"); 163MODULE_DESCRIPTION("CPUIMX ALSA SoC driver");
164MODULE_LICENSE("GPL"); 164MODULE_LICENSE("GPL");
165MODULE_ALIAS("platform:eukrea_tlv320");