summaryrefslogtreecommitdiffstats
path: root/sound/pci/fm801.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-06-10 14:46:48 +0200
committerJiri Kosina <jkosina@suse.cz>2011-06-10 14:46:57 +0200
commit5be5758c114b18260c6fd4c8373bf89e39b0fe82 (patch)
tree54390f904df6ff11e570f764c444356cf2709fda /sound/pci/fm801.c
parent71f66a6580c4e42df377bebbcca5c72661a40700 (diff)
parent7f45e5cd1718ed769295033ca214032848a0097d (diff)
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply patches against new code I have in queue.
Diffstat (limited to 'sound/pci/fm801.c')
-rw-r--r--sound/pci/fm801.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index eacd4901a30..a7ec7030cf8 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1234,9 +1234,12 @@ static int __devinit snd_fm801_create(struct snd_card *card,
sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 &&
(tea575x_tuner & TUNER_TYPE_MASK) < 4) {
- if (snd_tea575x_init(&chip->tea))
+ if (snd_tea575x_init(&chip->tea)) {
snd_printk(KERN_ERR "TEA575x radio not found\n");
- } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0)
+ snd_fm801_free(chip);
+ return -ENODEV;
+ }
+ } else if ((tea575x_tuner & TUNER_TYPE_MASK) == 0) {
/* autodetect tuner connection */
for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) {
chip->tea575x_tuner = tea575x_tuner;
@@ -1246,6 +1249,12 @@ static int __devinit snd_fm801_create(struct snd_card *card,
break;
}
}
+ if (tea575x_tuner == 4) {
+ snd_printk(KERN_ERR "TEA575x radio not found\n");
+ snd_fm801_free(chip);
+ return -ENODEV;
+ }
+ }
strlcpy(chip->tea.card, snd_fm801_tea575x_gpios[(tea575x_tuner & TUNER_TYPE_MASK) - 1].name, sizeof(chip->tea.card));
#endif