diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2011-09-22 09:39:52 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-09-22 09:52:52 -0400 |
commit | c37279b92aba2893578f61076cd2eef5c5fa0e99 (patch) | |
tree | 33b86eb2debe778484049b296667a1bf6f6b4da9 /sound/pci | |
parent | 2ba34e43ba0469086d1ff81c13a9aa9070c1a0e1 (diff) |
ALSA: fm801: Gracefully handle failure of tuner auto-detect
Commit 9676001559fce06e37c7dc230ab275f605556176
("ALSA: fm801: add error handling if auto-detect fails") seems to
break systems that were previously working without a tuner.
As a bonus, this should fix init and cleanup for the case where the
tuner is explicitly disabled.
Reported-and-tested-by: Hor Jiun Shyong <jiunshyong@gmail.com>
References: http://bugs.debian.org/641946
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@kernel.org [v3.0+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/fm801.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index a96456daf393..32b02d906703 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -68,6 +68,7 @@ MODULE_PARM_DESC(enable, "Enable FM801 soundcard."); | |||
68 | module_param_array(tea575x_tuner, int, NULL, 0444); | 68 | module_param_array(tea575x_tuner, int, NULL, 0444); |
69 | MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only)."); | 69 | MODULE_PARM_DESC(tea575x_tuner, "TEA575x tuner access method (0 = auto, 1 = SF256-PCS, 2=SF256-PCP, 3=SF64-PCR, 8=disable, +16=tuner-only)."); |
70 | 70 | ||
71 | #define TUNER_DISABLED (1<<3) | ||
71 | #define TUNER_ONLY (1<<4) | 72 | #define TUNER_ONLY (1<<4) |
72 | #define TUNER_TYPE_MASK (~TUNER_ONLY & 0xFFFF) | 73 | #define TUNER_TYPE_MASK (~TUNER_ONLY & 0xFFFF) |
73 | 74 | ||
@@ -1150,7 +1151,8 @@ static int snd_fm801_free(struct fm801 *chip) | |||
1150 | 1151 | ||
1151 | __end_hw: | 1152 | __end_hw: |
1152 | #ifdef CONFIG_SND_FM801_TEA575X_BOOL | 1153 | #ifdef CONFIG_SND_FM801_TEA575X_BOOL |
1153 | snd_tea575x_exit(&chip->tea); | 1154 | if (!(chip->tea575x_tuner & TUNER_DISABLED)) |
1155 | snd_tea575x_exit(&chip->tea); | ||
1154 | #endif | 1156 | #endif |
1155 | if (chip->irq >= 0) | 1157 | if (chip->irq >= 0) |
1156 | free_irq(chip->irq, chip); | 1158 | free_irq(chip->irq, chip); |
@@ -1250,10 +1252,15 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1250 | } | 1252 | } |
1251 | if (tea575x_tuner == 4) { | 1253 | if (tea575x_tuner == 4) { |
1252 | snd_printk(KERN_ERR "TEA575x radio not found\n"); | 1254 | snd_printk(KERN_ERR "TEA575x radio not found\n"); |
1253 | return -ENODEV; | 1255 | chip->tea575x_tuner = TUNER_DISABLED; |
1254 | } | 1256 | } |
1255 | } | 1257 | } |
1256 | strlcpy(chip->tea.card, snd_fm801_tea575x_gpios[(tea575x_tuner & TUNER_TYPE_MASK) - 1].name, sizeof(chip->tea.card)); | 1258 | if (!(chip->tea575x_tuner & TUNER_DISABLED)) { |
1259 | strlcpy(chip->tea.card, | ||
1260 | snd_fm801_tea575x_gpios[(tea575x_tuner & | ||
1261 | TUNER_TYPE_MASK) - 1].name, | ||
1262 | sizeof(chip->tea.card)); | ||
1263 | } | ||
1257 | #endif | 1264 | #endif |
1258 | 1265 | ||
1259 | *rchip = chip; | 1266 | *rchip = chip; |