aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-08-26 13:45:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-26 13:45:20 -0400
commit1941246dd98089dd637f44d3bd4f6cc1c61aa9e4 (patch)
tree45dcac88d48607391a4692dc316c91ccb86e2fe9 /sound/soc/omap
parent1ef708ea449e5eab2780020ec79485db80937833 (diff)
parente784539fe81490a982a013621d39a60c4fce427e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: ASoC: Fix error paths in N810 machine driver init and release clocks at exit ALSA: oxygen: prevent muting of nonexistent AC97 controls
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/n810.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 7694621ec40b..87d0ed01f65a 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -329,12 +329,14 @@ static int __init n810_soc_init(void)
329 sys_clkout2_src = clk_get(dev, "sys_clkout2_src"); 329 sys_clkout2_src = clk_get(dev, "sys_clkout2_src");
330 if (IS_ERR(sys_clkout2_src)) { 330 if (IS_ERR(sys_clkout2_src)) {
331 dev_err(dev, "Could not get sys_clkout2_src clock\n"); 331 dev_err(dev, "Could not get sys_clkout2_src clock\n");
332 return -ENODEV; 332 err = PTR_ERR(sys_clkout2_src);
333 goto err2;
333 } 334 }
334 sys_clkout2 = clk_get(dev, "sys_clkout2"); 335 sys_clkout2 = clk_get(dev, "sys_clkout2");
335 if (IS_ERR(sys_clkout2)) { 336 if (IS_ERR(sys_clkout2)) {
336 dev_err(dev, "Could not get sys_clkout2\n"); 337 dev_err(dev, "Could not get sys_clkout2\n");
337 goto err1; 338 err = PTR_ERR(sys_clkout2);
339 goto err3;
338 } 340 }
339 /* 341 /*
340 * Configure 12 MHz output on SYS_CLKOUT2. Therefore we must use 342 * Configure 12 MHz output on SYS_CLKOUT2. Therefore we must use
@@ -343,7 +345,8 @@ static int __init n810_soc_init(void)
343 func96m_clk = clk_get(dev, "func_96m_ck"); 345 func96m_clk = clk_get(dev, "func_96m_ck");
344 if (IS_ERR(func96m_clk)) { 346 if (IS_ERR(func96m_clk)) {
345 dev_err(dev, "Could not get func 96M clock\n"); 347 dev_err(dev, "Could not get func 96M clock\n");
346 goto err2; 348 err = PTR_ERR(func96m_clk);
349 goto err4;
347 } 350 }
348 clk_set_parent(sys_clkout2_src, func96m_clk); 351 clk_set_parent(sys_clkout2_src, func96m_clk);
349 clk_set_rate(sys_clkout2, 12000000); 352 clk_set_rate(sys_clkout2, 12000000);
@@ -356,20 +359,25 @@ static int __init n810_soc_init(void)
356 gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0); 359 gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0);
357 360
358 return 0; 361 return 0;
359err2: 362err4:
360 clk_put(sys_clkout2); 363 clk_put(sys_clkout2);
364err3:
365 clk_put(sys_clkout2_src);
366err2:
361 platform_device_del(n810_snd_device); 367 platform_device_del(n810_snd_device);
362err1: 368err1:
363 platform_device_put(n810_snd_device); 369 platform_device_put(n810_snd_device);
364 370
365 return err; 371 return err;
366
367} 372}
368 373
369static void __exit n810_soc_exit(void) 374static void __exit n810_soc_exit(void)
370{ 375{
371 gpio_free(N810_SPEAKER_AMP_GPIO); 376 gpio_free(N810_SPEAKER_AMP_GPIO);
372 gpio_free(N810_HEADSET_AMP_GPIO); 377 gpio_free(N810_HEADSET_AMP_GPIO);
378 clk_put(sys_clkout2_src);
379 clk_put(sys_clkout2);
380 clk_put(func96m_clk);
373 381
374 platform_device_unregister(n810_snd_device); 382 platform_device_unregister(n810_snd_device);
375} 383}