aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/ad1848
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/ad1848')
-rw-r--r--sound/isa/ad1848/ad1848.c37
-rw-r--r--sound/isa/ad1848/ad1848_lib.c2
2 files changed, 20 insertions, 19 deletions
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
index 8c399340cd72..3ebcc482b07a 100644
--- a/sound/isa/ad1848/ad1848.c
+++ b/sound/isa/ad1848/ad1848.c
@@ -91,35 +91,36 @@ static int __init snd_card_ad1848_probe(int dev)
91 irq[dev], 91 irq[dev],
92 dma1[dev], 92 dma1[dev],
93 thinkpad[dev] ? AD1848_HW_THINKPAD : AD1848_HW_DETECT, 93 thinkpad[dev] ? AD1848_HW_THINKPAD : AD1848_HW_DETECT,
94 &chip)) < 0) { 94 &chip)) < 0)
95 snd_card_free(card); 95 goto _err;
96 return err; 96
97 } 97 if ((err = snd_ad1848_pcm(chip, 0, &pcm)) < 0)
98 goto _err;
99
100 if ((err = snd_ad1848_mixer(chip)) < 0)
101 goto _err;
98 102
99 if ((err = snd_ad1848_pcm(chip, 0, &pcm)) < 0) {
100 snd_card_free(card);
101 return err;
102 }
103 if ((err = snd_ad1848_mixer(chip)) < 0) {
104 snd_card_free(card);
105 return err;
106 }
107 strcpy(card->driver, "AD1848"); 103 strcpy(card->driver, "AD1848");
108 strcpy(card->shortname, pcm->name); 104 strcpy(card->shortname, pcm->name);
109 105
110 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d", 106 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
111 pcm->name, chip->port, irq[dev], dma1[dev]); 107 pcm->name, chip->port, irq[dev], dma1[dev]);
112 108
113 if (thinkpad[dev]) { 109 if (thinkpad[dev])
114 strcat(card->longname, " [Thinkpad]"); 110 strcat(card->longname, " [Thinkpad]");
115 }
116 111
117 if ((err = snd_card_register(card)) < 0) { 112 if ((err = snd_card_set_generic_dev(card)) < 0)
118 snd_card_free(card); 113 goto _err;
119 return err; 114
120 } 115 if ((err = snd_card_register(card)) < 0)
116 goto _err;
117
121 snd_ad1848_cards[dev] = card; 118 snd_ad1848_cards[dev] = card;
122 return 0; 119 return 0;
120
121 _err:
122 snd_card_free(card);
123 return err;
123} 124}
124 125
125static int __init alsa_card_ad1848_init(void) 126static int __init alsa_card_ad1848_init(void)
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index bc642dc94547..303861cd03cd 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -890,7 +890,7 @@ int snd_ad1848_create(snd_card_t * card,
890 int err; 890 int err;
891 891
892 *rchip = NULL; 892 *rchip = NULL;
893 chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); 893 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
894 if (chip == NULL) 894 if (chip == NULL)
895 return -ENOMEM; 895 return -ENOMEM;
896 spin_lock_init(&chip->reg_lock); 896 spin_lock_init(&chip->reg_lock);