aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/fm801.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/fm801.c')
-rw-r--r--sound/pci/fm801.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index eacd4901a308..f9123f09e83e 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1199,7 +1199,7 @@ static int __devinit snd_fm801_create(struct snd_card *card,
1199 chip->port = pci_resource_start(pci, 0); 1199 chip->port = pci_resource_start(pci, 0);
1200 if ((tea575x_tuner & TUNER_ONLY) == 0) { 1200 if ((tea575x_tuner & TUNER_ONLY) == 0) {
1201 if (request_irq(pci->irq, snd_fm801_interrupt, IRQF_SHARED, 1201 if (request_irq(pci->irq, snd_fm801_interrupt, IRQF_SHARED,
1202 "FM801", chip)) { 1202 KBUILD_MODNAME, chip)) {
1203 snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->irq); 1203 snd_printk(KERN_ERR "unable to grab IRQ %d\n", chip->irq);
1204 snd_fm801_free(chip); 1204 snd_fm801_free(chip);
1205 return -EBUSY; 1205 return -EBUSY;
@@ -1234,9 +1234,12 @@ static int __devinit snd_fm801_create(struct snd_card *card,
1234 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); 1234 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
1235 if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 && 1235 if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 &&
1236 (tea575x_tuner & TUNER_TYPE_MASK) < 4) { 1236 (tea575x_tuner & TUNER_TYPE_MASK) < 4) {
1237 if (snd_tea575x_init(&chip->tea)) 1237 if (snd_tea575x_init(&chip->tea)) {
1238 snd_printk(KERN_ERR "TEA575x radio not found\n"); 1238 snd_printk(KERN_ERR "TEA575x radio not found\n");
1239 } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) 1239 snd_fm801_free(chip);
1240 return -ENODEV;
1241 }
1242 } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) {
1240 /* autodetect tuner connection */ 1243 /* autodetect tuner connection */
1241 for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) { 1244 for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) {
1242 chip->tea575x_tuner = tea575x_tuner; 1245 chip->tea575x_tuner = tea575x_tuner;
@@ -1246,6 +1249,12 @@ static int __devinit snd_fm801_create(struct snd_card *card,
1246 break; 1249 break;
1247 } 1250 }
1248 } 1251 }
1252 if (tea575x_tuner == 4) {
1253 snd_printk(KERN_ERR "TEA575x radio not found\n");
1254 snd_fm801_free(chip);
1255 return -ENODEV;
1256 }
1257 }
1249 strlcpy(chip->tea.card, snd_fm801_tea575x_gpios[(tea575x_tuner & TUNER_TYPE_MASK) - 1].name, sizeof(chip->tea.card)); 1258 strlcpy(chip->tea.card, snd_fm801_tea575x_gpios[(tea575x_tuner & TUNER_TYPE_MASK) - 1].name, sizeof(chip->tea.card));
1250#endif 1259#endif
1251 1260
@@ -1385,7 +1394,7 @@ static int snd_fm801_resume(struct pci_dev *pci)
1385#endif 1394#endif
1386 1395
1387static struct pci_driver driver = { 1396static struct pci_driver driver = {
1388 .name = "FM801", 1397 .name = KBUILD_MODNAME,
1389 .id_table = snd_fm801_ids, 1398 .id_table = snd_fm801_ids,
1390 .probe = snd_card_fm801_probe, 1399 .probe = snd_card_fm801_probe,
1391 .remove = __devexit_p(snd_card_fm801_remove), 1400 .remove = __devexit_p(snd_card_fm801_remove),