diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-01-14 08:56:55 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-01-14 08:56:55 -0500 |
commit | cf67c8e71bc15cf6b1843ab88c31cf732f2f2ff0 (patch) | |
tree | 90366daf7a8610c5b50ee3179a7a068c38b5f215 /sound/pci | |
parent | 358b7dfa1c32dfb77ff3261d244991a7c7c6d2cb (diff) |
ALSA: hda - Fix endless vmaster hook call in thinkpad_helper.c
The new vmaster hook, update_tpacpi_mute_led(), calls the original
vmaster hook, but I forgot to save the original hook function but keep
calling the updated one, which of course results in a stupid endless
loop. Fixed now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/thinkpad_helper.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/pci/hda/thinkpad_helper.c b/sound/pci/hda/thinkpad_helper.c index 8492b8a3ce47..5799fbc24c28 100644 --- a/sound/pci/hda/thinkpad_helper.c +++ b/sound/pci/hda/thinkpad_helper.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/thinkpad_acpi.h> | 8 | #include <linux/thinkpad_acpi.h> |
9 | 9 | ||
10 | static int (*led_set_func)(int, bool); | 10 | static int (*led_set_func)(int, bool); |
11 | static void (*old_vmaster_hook)(void *, int); | ||
11 | 12 | ||
12 | static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context, | 13 | static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context, |
13 | void **rv) | 14 | void **rv) |
@@ -30,11 +31,8 @@ static bool is_thinkpad(struct hda_codec *codec) | |||
30 | 31 | ||
31 | static void update_tpacpi_mute_led(void *private_data, int enabled) | 32 | static void update_tpacpi_mute_led(void *private_data, int enabled) |
32 | { | 33 | { |
33 | struct hda_codec *codec = private_data; | 34 | if (old_vmaster_hook) |
34 | struct hda_gen_spec *spec = codec->spec; | 35 | old_vmaster_hook(private_data, enabled); |
35 | |||
36 | if (spec->vmaster_mute.hook) | ||
37 | spec->vmaster_mute.hook(private_data, enabled); | ||
38 | 36 | ||
39 | if (led_set_func) | 37 | if (led_set_func) |
40 | led_set_func(TPACPI_LED_MUTE, !enabled); | 38 | led_set_func(TPACPI_LED_MUTE, !enabled); |
@@ -70,6 +68,7 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec, | |||
70 | 68 | ||
71 | removefunc = true; | 69 | removefunc = true; |
72 | if (led_set_func(TPACPI_LED_MUTE, false) >= 0) { | 70 | if (led_set_func(TPACPI_LED_MUTE, false) >= 0) { |
71 | old_vmaster_hook = spec->vmaster_mute.hook; | ||
73 | spec->vmaster_mute.hook = update_tpacpi_mute_led; | 72 | spec->vmaster_mute.hook = update_tpacpi_mute_led; |
74 | removefunc = false; | 73 | removefunc = false; |
75 | } | 74 | } |
@@ -86,6 +85,7 @@ static void hda_fixup_thinkpad_acpi(struct hda_codec *codec, | |||
86 | if (led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { | 85 | if (led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) { |
87 | symbol_put(tpacpi_led_set); | 86 | symbol_put(tpacpi_led_set); |
88 | led_set_func = NULL; | 87 | led_set_func = NULL; |
88 | old_vmaster_hook = NULL; | ||
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||