diff options
Diffstat (limited to 'sound/pci/fm801.c')
-rw-r--r-- | sound/pci/fm801.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index f9123f09e83e..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); |
@@ -1236,7 +1238,6 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1236 | (tea575x_tuner & TUNER_TYPE_MASK) < 4) { | 1238 | (tea575x_tuner & TUNER_TYPE_MASK) < 4) { |
1237 | if (snd_tea575x_init(&chip->tea)) { | 1239 | if (snd_tea575x_init(&chip->tea)) { |
1238 | snd_printk(KERN_ERR "TEA575x radio not found\n"); | 1240 | snd_printk(KERN_ERR "TEA575x radio not found\n"); |
1239 | snd_fm801_free(chip); | ||
1240 | return -ENODEV; | 1241 | return -ENODEV; |
1241 | } | 1242 | } |
1242 | } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) { | 1243 | } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) { |
@@ -1251,11 +1252,15 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1251 | } | 1252 | } |
1252 | if (tea575x_tuner == 4) { | 1253 | if (tea575x_tuner == 4) { |
1253 | snd_printk(KERN_ERR "TEA575x radio not found\n"); | 1254 | snd_printk(KERN_ERR "TEA575x radio not found\n"); |
1254 | snd_fm801_free(chip); | 1255 | chip->tea575x_tuner = TUNER_DISABLED; |
1255 | return -ENODEV; | ||
1256 | } | 1256 | } |
1257 | } | 1257 | } |
1258 | 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 | } | ||
1259 | #endif | 1264 | #endif |
1260 | 1265 | ||
1261 | *rchip = chip; | 1266 | *rchip = chip; |