diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-26 13:45:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-26 13:45:20 -0400 |
commit | 1941246dd98089dd637f44d3bd4f6cc1c61aa9e4 (patch) | |
tree | 45dcac88d48607391a4692dc316c91ccb86e2fe9 | |
parent | 1ef708ea449e5eab2780020ec79485db80937833 (diff) | |
parent | e784539fe81490a982a013621d39a60c4fce427e (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
-rw-r--r-- | sound/pci/oxygen/oxygen_mixer.c | 5 | ||||
-rw-r--r-- | sound/soc/omap/n810.c | 18 |
2 files changed, 17 insertions, 6 deletions
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 6facac5aed90..05eb8994c141 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -512,9 +512,12 @@ static int ac97_switch_get(struct snd_kcontrol *ctl, | |||
512 | 512 | ||
513 | static void mute_ac97_ctl(struct oxygen *chip, unsigned int control) | 513 | static void mute_ac97_ctl(struct oxygen *chip, unsigned int control) |
514 | { | 514 | { |
515 | unsigned int priv_idx = chip->controls[control]->private_value & 0xff; | 515 | unsigned int priv_idx; |
516 | u16 value; | 516 | u16 value; |
517 | 517 | ||
518 | if (!chip->controls[control]) | ||
519 | return; | ||
520 | priv_idx = chip->controls[control]->private_value & 0xff; | ||
518 | value = oxygen_read_ac97(chip, 0, priv_idx); | 521 | value = oxygen_read_ac97(chip, 0, priv_idx); |
519 | if (!(value & 0x8000)) { | 522 | if (!(value & 0x8000)) { |
520 | oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000); | 523 | oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000); |
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; |
359 | err2: | 362 | err4: |
360 | clk_put(sys_clkout2); | 363 | clk_put(sys_clkout2); |
364 | err3: | ||
365 | clk_put(sys_clkout2_src); | ||
366 | err2: | ||
361 | platform_device_del(n810_snd_device); | 367 | platform_device_del(n810_snd_device); |
362 | err1: | 368 | err1: |
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 | ||
369 | static void __exit n810_soc_exit(void) | 374 | static 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 | } |