diff options
Diffstat (limited to 'sound/isa')
30 files changed, 262 insertions, 291 deletions
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig index 5915dc41c0ee..4e06bbd9298d 100644 --- a/sound/isa/Kconfig +++ b/sound/isa/Kconfig | |||
@@ -56,8 +56,8 @@ config SND_AD1848 | |||
56 | Say Y here to include support for AD1848 (Analog Devices) or | 56 | Say Y here to include support for AD1848 (Analog Devices) or |
57 | CS4248 (Cirrus Logic - Crystal Semiconductors) chips. | 57 | CS4248 (Cirrus Logic - Crystal Semiconductors) chips. |
58 | 58 | ||
59 | For newer chips from Cirrus Logic, use the CS4231, CS4232 or | 59 | For newer chips from Cirrus Logic, use the CS4231 or CS4232+ |
60 | CS4236+ drivers. | 60 | drivers. |
61 | 61 | ||
62 | To compile this driver as a module, choose M here: the module | 62 | To compile this driver as a module, choose M here: the module |
63 | will be called snd-ad1848. | 63 | will be called snd-ad1848. |
@@ -114,26 +114,15 @@ config SND_CS4231 | |||
114 | To compile this driver as a module, choose M here: the module | 114 | To compile this driver as a module, choose M here: the module |
115 | will be called snd-cs4231. | 115 | will be called snd-cs4231. |
116 | 116 | ||
117 | config SND_CS4232 | ||
118 | tristate "Generic Cirrus Logic CS4232 driver" | ||
119 | select SND_OPL3_LIB | ||
120 | select SND_MPU401_UART | ||
121 | select SND_WSS_LIB | ||
122 | help | ||
123 | Say Y here to include support for CS4232 chips from Cirrus | ||
124 | Logic - Crystal Semiconductors. | ||
125 | |||
126 | To compile this driver as a module, choose M here: the module | ||
127 | will be called snd-cs4232. | ||
128 | |||
129 | config SND_CS4236 | 117 | config SND_CS4236 |
130 | tristate "Generic Cirrus Logic CS4236+ driver" | 118 | tristate "Generic Cirrus Logic CS4232/CS4236+ driver" |
131 | select SND_OPL3_LIB | 119 | select SND_OPL3_LIB |
132 | select SND_MPU401_UART | 120 | select SND_MPU401_UART |
133 | select SND_WSS_LIB | 121 | select SND_WSS_LIB |
134 | help | 122 | help |
135 | Say Y to include support for CS4235,CS4236,CS4237B,CS4238B, | 123 | Say Y to include support for CS4232,CS4235,CS4236,CS4237B, |
136 | CS4239 chips from Cirrus Logic - Crystal Semiconductors. | 124 | CS4238B,CS4239 chips from Cirrus Logic - Crystal |
125 | Semiconductors. | ||
137 | 126 | ||
138 | To compile this driver as a module, choose M here: the module | 127 | To compile this driver as a module, choose M here: the module |
139 | will be called snd-cs4236. | 128 | will be called snd-cs4236. |
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c index 15f60107a11e..bbcbf92a8ebe 100644 --- a/sound/isa/ad1816a/ad1816a.c +++ b/sound/isa/ad1816a/ad1816a.c | |||
@@ -158,9 +158,10 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard | |||
158 | struct snd_opl3 *opl3; | 158 | struct snd_opl3 *opl3; |
159 | struct snd_timer *timer; | 159 | struct snd_timer *timer; |
160 | 160 | ||
161 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 161 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
162 | sizeof(struct snd_card_ad1816a))) == NULL) | 162 | sizeof(struct snd_card_ad1816a), &card); |
163 | return -ENOMEM; | 163 | if (error < 0) |
164 | return error; | ||
164 | acard = (struct snd_card_ad1816a *)card->private_data; | 165 | acard = (struct snd_card_ad1816a *)card->private_data; |
165 | 166 | ||
166 | if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) { | 167 | if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) { |
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c index 223a6c038819..4beeb6f98e0e 100644 --- a/sound/isa/ad1848/ad1848.c +++ b/sound/isa/ad1848/ad1848.c | |||
@@ -91,9 +91,9 @@ static int __devinit snd_ad1848_probe(struct device *dev, unsigned int n) | |||
91 | struct snd_pcm *pcm; | 91 | struct snd_pcm *pcm; |
92 | int error; | 92 | int error; |
93 | 93 | ||
94 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 94 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
95 | if (!card) | 95 | if (error < 0) |
96 | return -EINVAL; | 96 | return error; |
97 | 97 | ||
98 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], -1, | 98 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], -1, |
99 | thinkpad[n] ? WSS_HW_THINKPAD : WSS_HW_DETECT, | 99 | thinkpad[n] ? WSS_HW_THINKPAD : WSS_HW_DETECT, |
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c index 374b7177e111..7465ae036e0b 100644 --- a/sound/isa/adlib.c +++ b/sound/isa/adlib.c | |||
@@ -53,10 +53,10 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n) | |||
53 | struct snd_opl3 *opl3; | 53 | struct snd_opl3 *opl3; |
54 | int error; | 54 | int error; |
55 | 55 | ||
56 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 56 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
57 | if (!card) { | 57 | if (error < 0) { |
58 | dev_err(dev, "could not create card\n"); | 58 | dev_err(dev, "could not create card\n"); |
59 | return -EINVAL; | 59 | return error; |
60 | } | 60 | } |
61 | 61 | ||
62 | card->private_data = request_region(port[n], 4, CRD_NAME); | 62 | card->private_data = request_region(port[n], 4, CRD_NAME); |
diff --git a/sound/isa/als100.c b/sound/isa/als100.c index f1ce30f379c9..5fd52e4d7079 100644 --- a/sound/isa/als100.c +++ b/sound/isa/als100.c | |||
@@ -163,9 +163,10 @@ static int __devinit snd_card_als100_probe(int dev, | |||
163 | struct snd_card_als100 *acard; | 163 | struct snd_card_als100 *acard; |
164 | struct snd_opl3 *opl3; | 164 | struct snd_opl3 *opl3; |
165 | 165 | ||
166 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 166 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
167 | sizeof(struct snd_card_als100))) == NULL) | 167 | sizeof(struct snd_card_als100), &card); |
168 | return -ENOMEM; | 168 | if (error < 0) |
169 | return error; | ||
169 | acard = card->private_data; | 170 | acard = card->private_data; |
170 | 171 | ||
171 | if ((error = snd_card_als100_pnp(dev, acard, pcard, pid))) { | 172 | if ((error = snd_card_als100_pnp(dev, acard, pcard, pid))) { |
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c index 3e74d1a3928e..f7aa637b0d18 100644 --- a/sound/isa/azt2320.c +++ b/sound/isa/azt2320.c | |||
@@ -184,9 +184,10 @@ static int __devinit snd_card_azt2320_probe(int dev, | |||
184 | struct snd_wss *chip; | 184 | struct snd_wss *chip; |
185 | struct snd_opl3 *opl3; | 185 | struct snd_opl3 *opl3; |
186 | 186 | ||
187 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 187 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
188 | sizeof(struct snd_card_azt2320))) == NULL) | 188 | sizeof(struct snd_card_azt2320), &card); |
189 | return -ENOMEM; | 189 | if (error < 0) |
190 | return error; | ||
190 | acard = (struct snd_card_azt2320 *)card->private_data; | 191 | acard = (struct snd_card_azt2320 *)card->private_data; |
191 | 192 | ||
192 | if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) { | 193 | if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) { |
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 9ca8122f7ba2..de83608719ea 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -497,20 +497,22 @@ static int snd_cmi8330_resume(struct snd_card *card) | |||
497 | 497 | ||
498 | #define PFX "cmi8330: " | 498 | #define PFX "cmi8330: " |
499 | 499 | ||
500 | static struct snd_card *snd_cmi8330_card_new(int dev) | 500 | static int snd_cmi8330_card_new(int dev, struct snd_card **cardp) |
501 | { | 501 | { |
502 | struct snd_card *card; | 502 | struct snd_card *card; |
503 | struct snd_cmi8330 *acard; | 503 | struct snd_cmi8330 *acard; |
504 | int err; | ||
504 | 505 | ||
505 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 506 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
506 | sizeof(struct snd_cmi8330)); | 507 | sizeof(struct snd_cmi8330), &card); |
507 | if (card == NULL) { | 508 | if (err < 0) { |
508 | snd_printk(KERN_ERR PFX "could not get a new card\n"); | 509 | snd_printk(KERN_ERR PFX "could not get a new card\n"); |
509 | return NULL; | 510 | return err; |
510 | } | 511 | } |
511 | acard = card->private_data; | 512 | acard = card->private_data; |
512 | acard->card = card; | 513 | acard->card = card; |
513 | return card; | 514 | *cardp = card; |
515 | return 0; | ||
514 | } | 516 | } |
515 | 517 | ||
516 | static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) | 518 | static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev) |
@@ -616,9 +618,9 @@ static int __devinit snd_cmi8330_isa_probe(struct device *pdev, | |||
616 | struct snd_card *card; | 618 | struct snd_card *card; |
617 | int err; | 619 | int err; |
618 | 620 | ||
619 | card = snd_cmi8330_card_new(dev); | 621 | err = snd_cmi8330_card_new(dev, &card); |
620 | if (! card) | 622 | if (err < 0) |
621 | return -ENOMEM; | 623 | return err; |
622 | snd_card_set_dev(card, pdev); | 624 | snd_card_set_dev(card, pdev); |
623 | if ((err = snd_cmi8330_probe(card, dev)) < 0) { | 625 | if ((err = snd_cmi8330_probe(card, dev)) < 0) { |
624 | snd_card_free(card); | 626 | snd_card_free(card); |
@@ -680,9 +682,9 @@ static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard, | |||
680 | if (dev >= SNDRV_CARDS) | 682 | if (dev >= SNDRV_CARDS) |
681 | return -ENODEV; | 683 | return -ENODEV; |
682 | 684 | ||
683 | card = snd_cmi8330_card_new(dev); | 685 | res = snd_cmi8330_card_new(dev, &card); |
684 | if (! card) | 686 | if (res < 0) |
685 | return -ENOMEM; | 687 | return res; |
686 | if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { | 688 | if ((res = snd_cmi8330_pnp(dev, card->private_data, pcard, pid)) < 0) { |
687 | snd_printk(KERN_ERR PFX "PnP detection failed\n"); | 689 | snd_printk(KERN_ERR PFX "PnP detection failed\n"); |
688 | snd_card_free(card); | 690 | snd_card_free(card); |
diff --git a/sound/isa/cs423x/Makefile b/sound/isa/cs423x/Makefile index 5870ca21ab59..6d397e8d54ac 100644 --- a/sound/isa/cs423x/Makefile +++ b/sound/isa/cs423x/Makefile | |||
@@ -3,13 +3,11 @@ | |||
3 | # Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz> | 3 | # Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz> |
4 | # | 4 | # |
5 | 5 | ||
6 | snd-cs4236-lib-objs := cs4236_lib.o | ||
7 | snd-cs4231-objs := cs4231.o | 6 | snd-cs4231-objs := cs4231.o |
8 | snd-cs4232-objs := cs4232.o | 7 | snd-cs4236-objs := cs4236.o cs4236_lib.o |
9 | snd-cs4236-objs := cs4236.o | ||
10 | 8 | ||
11 | # Toplevel Module Dependency | 9 | # Toplevel Module Dependency |
12 | obj-$(CONFIG_SND_CS4231) += snd-cs4231.o | 10 | obj-$(CONFIG_SND_CS4231) += snd-cs4231.o |
13 | obj-$(CONFIG_SND_CS4232) += snd-cs4232.o | 11 | obj-$(CONFIG_SND_CS4236) += snd-cs4236.o |
14 | obj-$(CONFIG_SND_CS4236) += snd-cs4236.o snd-cs4236-lib.o | 12 | |
15 | 13 | ||
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index f019d449e2d6..cb9153e75b82 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c | |||
@@ -95,9 +95,9 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n) | |||
95 | struct snd_pcm *pcm; | 95 | struct snd_pcm *pcm; |
96 | int error; | 96 | int error; |
97 | 97 | ||
98 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 98 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
99 | if (!card) | 99 | if (error < 0) |
100 | return -EINVAL; | 100 | return error; |
101 | 101 | ||
102 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n], | 102 | error = snd_wss_create(card, port[n], -1, irq[n], dma1[n], dma2[n], |
103 | WSS_HW_DETECT, 0, &chip); | 103 | WSS_HW_DETECT, 0, &chip); |
diff --git a/sound/isa/cs423x/cs4232.c b/sound/isa/cs423x/cs4232.c deleted file mode 100644 index 9fad2e6c0c2c..000000000000 --- a/sound/isa/cs423x/cs4232.c +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #define CS4232 | ||
2 | #include "cs4236.c" | ||
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 019c9401663e..a076a6ce8071 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
@@ -33,17 +33,14 @@ | |||
33 | 33 | ||
34 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); | 34 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); |
35 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |
36 | #ifdef CS4232 | 36 | MODULE_DESCRIPTION("Cirrus Logic CS4232-9"); |
37 | MODULE_DESCRIPTION("Cirrus Logic CS4232"); | ||
38 | MODULE_SUPPORTED_DEVICE("{{Turtle Beach,TBS-2000}," | 37 | MODULE_SUPPORTED_DEVICE("{{Turtle Beach,TBS-2000}," |
39 | "{Turtle Beach,Tropez Plus}," | 38 | "{Turtle Beach,Tropez Plus}," |
40 | "{SIC CrystalWave 32}," | 39 | "{SIC CrystalWave 32}," |
41 | "{Hewlett Packard,Omnibook 5500}," | 40 | "{Hewlett Packard,Omnibook 5500}," |
42 | "{TerraTec,Maestro 32/96}," | 41 | "{TerraTec,Maestro 32/96}," |
43 | "{Philips,PCA70PS}}"); | 42 | "{Philips,PCA70PS}}," |
44 | #else | 43 | "{{Crystal Semiconductors,CS4235}," |
45 | MODULE_DESCRIPTION("Cirrus Logic CS4235-9"); | ||
46 | MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4235}," | ||
47 | "{Crystal Semiconductors,CS4236}," | 44 | "{Crystal Semiconductors,CS4236}," |
48 | "{Crystal Semiconductors,CS4237}," | 45 | "{Crystal Semiconductors,CS4237}," |
49 | "{Crystal Semiconductors,CS4238}," | 46 | "{Crystal Semiconductors,CS4238}," |
@@ -70,15 +67,11 @@ MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4235}," | |||
70 | "{Typhoon Soundsystem,CS4236B}," | 67 | "{Typhoon Soundsystem,CS4236B}," |
71 | "{Turtle Beach,Malibu}," | 68 | "{Turtle Beach,Malibu}," |
72 | "{Unknown,Digital PC 5000 Onboard}}"); | 69 | "{Unknown,Digital PC 5000 Onboard}}"); |
73 | #endif | ||
74 | 70 | ||
75 | #ifdef CS4232 | 71 | MODULE_ALIAS("snd_cs4232"); |
76 | #define IDENT "CS4232" | 72 | |
77 | #define DEV_NAME "cs4232" | 73 | #define IDENT "CS4232+" |
78 | #else | 74 | #define DEV_NAME "cs4232+" |
79 | #define IDENT "CS4236+" | ||
80 | #define DEV_NAME "cs4236" | ||
81 | #endif | ||
82 | 75 | ||
83 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ | 76 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ |
84 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ | 77 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ |
@@ -128,9 +121,7 @@ MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); | |||
128 | #ifdef CONFIG_PNP | 121 | #ifdef CONFIG_PNP |
129 | static int isa_registered; | 122 | static int isa_registered; |
130 | static int pnpc_registered; | 123 | static int pnpc_registered; |
131 | #ifdef CS4232 | ||
132 | static int pnp_registered; | 124 | static int pnp_registered; |
133 | #endif | ||
134 | #endif /* CONFIG_PNP */ | 125 | #endif /* CONFIG_PNP */ |
135 | 126 | ||
136 | struct snd_card_cs4236 { | 127 | struct snd_card_cs4236 { |
@@ -145,11 +136,10 @@ struct snd_card_cs4236 { | |||
145 | 136 | ||
146 | #ifdef CONFIG_PNP | 137 | #ifdef CONFIG_PNP |
147 | 138 | ||
148 | #ifdef CS4232 | ||
149 | /* | 139 | /* |
150 | * PNP BIOS | 140 | * PNP BIOS |
151 | */ | 141 | */ |
152 | static const struct pnp_device_id snd_cs4232_pnpbiosids[] = { | 142 | static const struct pnp_device_id snd_cs423x_pnpbiosids[] = { |
153 | { .id = "CSC0100" }, | 143 | { .id = "CSC0100" }, |
154 | { .id = "CSC0000" }, | 144 | { .id = "CSC0000" }, |
155 | /* Guillemot Turtlebeach something appears to be cs4232 compatible | 145 | /* Guillemot Turtlebeach something appears to be cs4232 compatible |
@@ -157,10 +147,8 @@ static const struct pnp_device_id snd_cs4232_pnpbiosids[] = { | |||
157 | { .id = "GIM0100" }, | 147 | { .id = "GIM0100" }, |
158 | { .id = "" } | 148 | { .id = "" } |
159 | }; | 149 | }; |
160 | MODULE_DEVICE_TABLE(pnp, snd_cs4232_pnpbiosids); | 150 | MODULE_DEVICE_TABLE(pnp, snd_cs423x_pnpbiosids); |
161 | #endif /* CS4232 */ | ||
162 | 151 | ||
163 | #ifdef CS4232 | ||
164 | #define CS423X_ISAPNP_DRIVER "cs4232_isapnp" | 152 | #define CS423X_ISAPNP_DRIVER "cs4232_isapnp" |
165 | static struct pnp_card_device_id snd_cs423x_pnpids[] = { | 153 | static struct pnp_card_device_id snd_cs423x_pnpids[] = { |
166 | /* Philips PCA70PS */ | 154 | /* Philips PCA70PS */ |
@@ -179,12 +167,6 @@ static struct pnp_card_device_id snd_cs423x_pnpids[] = { | |||
179 | { .id = "CSCf032", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } }, | 167 | { .id = "CSCf032", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } }, |
180 | /* Netfinity 3000 on-board soundcard */ | 168 | /* Netfinity 3000 on-board soundcard */ |
181 | { .id = "CSCe825", .devs = { { "CSC0100" }, { "CSC0110" }, { "CSC010f" } } }, | 169 | { .id = "CSCe825", .devs = { { "CSC0100" }, { "CSC0110" }, { "CSC010f" } } }, |
182 | /* --- */ | ||
183 | { .id = "" } /* end */ | ||
184 | }; | ||
185 | #else /* CS4236 */ | ||
186 | #define CS423X_ISAPNP_DRIVER "cs4236_isapnp" | ||
187 | static struct pnp_card_device_id snd_cs423x_pnpids[] = { | ||
188 | /* Intel Marlin Spike Motherboard - CS4235 */ | 170 | /* Intel Marlin Spike Motherboard - CS4235 */ |
189 | { .id = "CSC0225", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } }, | 171 | { .id = "CSC0225", .devs = { { "CSC0000" }, { "CSC0010" }, { "CSC0003" } } }, |
190 | /* Intel Marlin Spike Motherboard (#2) - CS4235 */ | 172 | /* Intel Marlin Spike Motherboard (#2) - CS4235 */ |
@@ -266,7 +248,6 @@ static struct pnp_card_device_id snd_cs423x_pnpids[] = { | |||
266 | /* --- */ | 248 | /* --- */ |
267 | { .id = "" } /* end */ | 249 | { .id = "" } /* end */ |
268 | }; | 250 | }; |
269 | #endif | ||
270 | 251 | ||
271 | MODULE_DEVICE_TABLE(pnp_card, snd_cs423x_pnpids); | 252 | MODULE_DEVICE_TABLE(pnp_card, snd_cs423x_pnpids); |
272 | 253 | ||
@@ -323,17 +304,19 @@ static int __devinit snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev) | |||
323 | return 0; | 304 | return 0; |
324 | } | 305 | } |
325 | 306 | ||
326 | #ifdef CS4232 | 307 | static int __devinit snd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard, |
327 | static int __devinit snd_card_cs4232_pnp(int dev, struct snd_card_cs4236 *acard, | 308 | struct pnp_dev *pdev, |
328 | struct pnp_dev *pdev) | 309 | struct pnp_dev *cdev) |
329 | { | 310 | { |
330 | acard->wss = pdev; | 311 | acard->wss = pdev; |
331 | if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0) | 312 | if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0) |
332 | return -EBUSY; | 313 | return -EBUSY; |
333 | cport[dev] = -1; | 314 | if (cdev) |
315 | cport[dev] = pnp_port_start(cdev, 0); | ||
316 | else | ||
317 | cport[dev] = -1; | ||
334 | return 0; | 318 | return 0; |
335 | } | 319 | } |
336 | #endif | ||
337 | 320 | ||
338 | static int __devinit snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard, | 321 | static int __devinit snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard, |
339 | struct pnp_card_link *card, | 322 | struct pnp_card_link *card, |
@@ -382,16 +365,18 @@ static void snd_card_cs4236_free(struct snd_card *card) | |||
382 | release_and_free_resource(acard->res_sb_port); | 365 | release_and_free_resource(acard->res_sb_port); |
383 | } | 366 | } |
384 | 367 | ||
385 | static struct snd_card *snd_cs423x_card_new(int dev) | 368 | static int snd_cs423x_card_new(int dev, struct snd_card **cardp) |
386 | { | 369 | { |
387 | struct snd_card *card; | 370 | struct snd_card *card; |
371 | int err; | ||
388 | 372 | ||
389 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 373 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
390 | sizeof(struct snd_card_cs4236)); | 374 | sizeof(struct snd_card_cs4236), &card); |
391 | if (card == NULL) | 375 | if (err < 0) |
392 | return NULL; | 376 | return err; |
393 | card->private_free = snd_card_cs4236_free; | 377 | card->private_free = snd_card_cs4236_free; |
394 | return card; | 378 | *cardp = card; |
379 | return 0; | ||
395 | } | 380 | } |
396 | 381 | ||
397 | static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) | 382 | static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) |
@@ -409,40 +394,39 @@ static int __devinit snd_cs423x_probe(struct snd_card *card, int dev) | |||
409 | return -EBUSY; | 394 | return -EBUSY; |
410 | } | 395 | } |
411 | 396 | ||
412 | #ifdef CS4232 | ||
413 | err = snd_wss_create(card, port[dev], cport[dev], | 397 | err = snd_wss_create(card, port[dev], cport[dev], |
414 | irq[dev], | 398 | irq[dev], |
415 | dma1[dev], dma2[dev], | 399 | dma1[dev], dma2[dev], |
416 | WSS_HW_DETECT, 0, &chip); | 400 | WSS_HW_DETECT3, 0, &chip); |
417 | if (err < 0) | ||
418 | return err; | ||
419 | acard->chip = chip; | ||
420 | |||
421 | err = snd_wss_pcm(chip, 0, &pcm); | ||
422 | if (err < 0) | ||
423 | return err; | ||
424 | |||
425 | err = snd_wss_mixer(chip); | ||
426 | if (err < 0) | 401 | if (err < 0) |
427 | return err; | 402 | return err; |
428 | 403 | if (chip->hardware & WSS_HW_CS4236B_MASK) { | |
429 | #else /* CS4236 */ | 404 | snd_wss_free(chip); |
430 | err = snd_cs4236_create(card, | 405 | err = snd_cs4236_create(card, |
431 | port[dev], cport[dev], | 406 | port[dev], cport[dev], |
432 | irq[dev], dma1[dev], dma2[dev], | 407 | irq[dev], dma1[dev], dma2[dev], |
433 | WSS_HW_DETECT, 0, &chip); | 408 | WSS_HW_DETECT, 0, &chip); |
434 | if (err < 0) | 409 | if (err < 0) |
435 | return err; | 410 | return err; |
436 | acard->chip = chip; | 411 | acard->chip = chip; |
437 | 412 | ||
438 | err = snd_cs4236_pcm(chip, 0, &pcm); | 413 | err = snd_cs4236_pcm(chip, 0, &pcm); |
439 | if (err < 0) | 414 | if (err < 0) |
440 | return err; | 415 | return err; |
441 | 416 | ||
442 | err = snd_cs4236_mixer(chip); | 417 | err = snd_cs4236_mixer(chip); |
443 | if (err < 0) | 418 | if (err < 0) |
444 | return err; | 419 | return err; |
445 | #endif | 420 | } else { |
421 | acard->chip = chip; | ||
422 | err = snd_wss_pcm(chip, 0, &pcm); | ||
423 | if (err < 0) | ||
424 | return err; | ||
425 | |||
426 | err = snd_wss_mixer(chip); | ||
427 | if (err < 0) | ||
428 | return err; | ||
429 | } | ||
446 | strcpy(card->driver, pcm->name); | 430 | strcpy(card->driver, pcm->name); |
447 | strcpy(card->shortname, pcm->name); | 431 | strcpy(card->shortname, pcm->name); |
448 | sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", | 432 | sprintf(card->longname, "%s at 0x%lx, irq %i, dma %i", |
@@ -512,9 +496,9 @@ static int __devinit snd_cs423x_isa_probe(struct device *pdev, | |||
512 | struct snd_card *card; | 496 | struct snd_card *card; |
513 | int err; | 497 | int err; |
514 | 498 | ||
515 | card = snd_cs423x_card_new(dev); | 499 | err = snd_cs423x_card_new(dev, &card); |
516 | if (! card) | 500 | if (err < 0) |
517 | return -ENOMEM; | 501 | return err; |
518 | snd_card_set_dev(card, pdev); | 502 | snd_card_set_dev(card, pdev); |
519 | if ((err = snd_cs423x_probe(card, dev)) < 0) { | 503 | if ((err = snd_cs423x_probe(card, dev)) < 0) { |
520 | snd_card_free(card); | 504 | snd_card_free(card); |
@@ -577,13 +561,14 @@ static struct isa_driver cs423x_isa_driver = { | |||
577 | 561 | ||
578 | 562 | ||
579 | #ifdef CONFIG_PNP | 563 | #ifdef CONFIG_PNP |
580 | #ifdef CS4232 | 564 | static int __devinit snd_cs423x_pnpbios_detect(struct pnp_dev *pdev, |
581 | static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev, | ||
582 | const struct pnp_device_id *id) | 565 | const struct pnp_device_id *id) |
583 | { | 566 | { |
584 | static int dev; | 567 | static int dev; |
585 | int err; | 568 | int err; |
586 | struct snd_card *card; | 569 | struct snd_card *card; |
570 | struct pnp_dev *cdev; | ||
571 | char cid[PNP_ID_LEN]; | ||
587 | 572 | ||
588 | if (pnp_device_is_isapnp(pdev)) | 573 | if (pnp_device_is_isapnp(pdev)) |
589 | return -ENOENT; /* we have another procedure - card */ | 574 | return -ENOENT; /* we have another procedure - card */ |
@@ -594,10 +579,19 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev, | |||
594 | if (dev >= SNDRV_CARDS) | 579 | if (dev >= SNDRV_CARDS) |
595 | return -ENODEV; | 580 | return -ENODEV; |
596 | 581 | ||
597 | card = snd_cs423x_card_new(dev); | 582 | /* prepare second id */ |
598 | if (! card) | 583 | strcpy(cid, pdev->id[0].id); |
599 | return -ENOMEM; | 584 | cid[5] = '1'; |
600 | if ((err = snd_card_cs4232_pnp(dev, card->private_data, pdev)) < 0) { | 585 | cdev = NULL; |
586 | list_for_each_entry(cdev, &(pdev->protocol->devices), protocol_list) { | ||
587 | if (!strcmp(cdev->id[0].id, cid)) | ||
588 | break; | ||
589 | } | ||
590 | err = snd_cs423x_card_new(dev, &card); | ||
591 | if (err < 0) | ||
592 | return err; | ||
593 | err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev); | ||
594 | if (err < 0) { | ||
601 | printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); | 595 | printk(KERN_ERR "PnP BIOS detection failed for " IDENT "\n"); |
602 | snd_card_free(card); | 596 | snd_card_free(card); |
603 | return err; | 597 | return err; |
@@ -612,35 +606,34 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev, | |||
612 | return 0; | 606 | return 0; |
613 | } | 607 | } |
614 | 608 | ||
615 | static void __devexit snd_cs4232_pnp_remove(struct pnp_dev * pdev) | 609 | static void __devexit snd_cs423x_pnp_remove(struct pnp_dev *pdev) |
616 | { | 610 | { |
617 | snd_card_free(pnp_get_drvdata(pdev)); | 611 | snd_card_free(pnp_get_drvdata(pdev)); |
618 | pnp_set_drvdata(pdev, NULL); | 612 | pnp_set_drvdata(pdev, NULL); |
619 | } | 613 | } |
620 | 614 | ||
621 | #ifdef CONFIG_PM | 615 | #ifdef CONFIG_PM |
622 | static int snd_cs4232_pnp_suspend(struct pnp_dev *pdev, pm_message_t state) | 616 | static int snd_cs423x_pnp_suspend(struct pnp_dev *pdev, pm_message_t state) |
623 | { | 617 | { |
624 | return snd_cs423x_suspend(pnp_get_drvdata(pdev)); | 618 | return snd_cs423x_suspend(pnp_get_drvdata(pdev)); |
625 | } | 619 | } |
626 | 620 | ||
627 | static int snd_cs4232_pnp_resume(struct pnp_dev *pdev) | 621 | static int snd_cs423x_pnp_resume(struct pnp_dev *pdev) |
628 | { | 622 | { |
629 | return snd_cs423x_resume(pnp_get_drvdata(pdev)); | 623 | return snd_cs423x_resume(pnp_get_drvdata(pdev)); |
630 | } | 624 | } |
631 | #endif | 625 | #endif |
632 | 626 | ||
633 | static struct pnp_driver cs4232_pnp_driver = { | 627 | static struct pnp_driver cs423x_pnp_driver = { |
634 | .name = "cs4232-pnpbios", | 628 | .name = "cs423x-pnpbios", |
635 | .id_table = snd_cs4232_pnpbiosids, | 629 | .id_table = snd_cs423x_pnpbiosids, |
636 | .probe = snd_cs4232_pnpbios_detect, | 630 | .probe = snd_cs423x_pnpbios_detect, |
637 | .remove = __devexit_p(snd_cs4232_pnp_remove), | 631 | .remove = __devexit_p(snd_cs423x_pnp_remove), |
638 | #ifdef CONFIG_PM | 632 | #ifdef CONFIG_PM |
639 | .suspend = snd_cs4232_pnp_suspend, | 633 | .suspend = snd_cs423x_pnp_suspend, |
640 | .resume = snd_cs4232_pnp_resume, | 634 | .resume = snd_cs423x_pnp_resume, |
641 | #endif | 635 | #endif |
642 | }; | 636 | }; |
643 | #endif /* CS4232 */ | ||
644 | 637 | ||
645 | static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, | 638 | static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, |
646 | const struct pnp_card_device_id *pid) | 639 | const struct pnp_card_device_id *pid) |
@@ -656,9 +649,9 @@ static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, | |||
656 | if (dev >= SNDRV_CARDS) | 649 | if (dev >= SNDRV_CARDS) |
657 | return -ENODEV; | 650 | return -ENODEV; |
658 | 651 | ||
659 | card = snd_cs423x_card_new(dev); | 652 | res = snd_cs423x_card_new(dev, &card); |
660 | if (! card) | 653 | if (res < 0) |
661 | return -ENOMEM; | 654 | return res; |
662 | if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) { | 655 | if ((res = snd_card_cs423x_pnpc(dev, card->private_data, pcard, pid)) < 0) { |
663 | printk(KERN_ERR "isapnp detection failed and probing for " IDENT | 656 | printk(KERN_ERR "isapnp detection failed and probing for " IDENT |
664 | " is not supported\n"); | 657 | " is not supported\n"); |
@@ -714,18 +707,14 @@ static int __init alsa_card_cs423x_init(void) | |||
714 | #ifdef CONFIG_PNP | 707 | #ifdef CONFIG_PNP |
715 | if (!err) | 708 | if (!err) |
716 | isa_registered = 1; | 709 | isa_registered = 1; |
717 | #ifdef CS4232 | 710 | err = pnp_register_driver(&cs423x_pnp_driver); |
718 | err = pnp_register_driver(&cs4232_pnp_driver); | ||
719 | if (!err) | 711 | if (!err) |
720 | pnp_registered = 1; | 712 | pnp_registered = 1; |
721 | #endif | ||
722 | err = pnp_register_card_driver(&cs423x_pnpc_driver); | 713 | err = pnp_register_card_driver(&cs423x_pnpc_driver); |
723 | if (!err) | 714 | if (!err) |
724 | pnpc_registered = 1; | 715 | pnpc_registered = 1; |
725 | #ifdef CS4232 | ||
726 | if (pnp_registered) | 716 | if (pnp_registered) |
727 | err = 0; | 717 | err = 0; |
728 | #endif | ||
729 | if (isa_registered) | 718 | if (isa_registered) |
730 | err = 0; | 719 | err = 0; |
731 | #endif | 720 | #endif |
@@ -737,10 +726,8 @@ static void __exit alsa_card_cs423x_exit(void) | |||
737 | #ifdef CONFIG_PNP | 726 | #ifdef CONFIG_PNP |
738 | if (pnpc_registered) | 727 | if (pnpc_registered) |
739 | pnp_unregister_card_driver(&cs423x_pnpc_driver); | 728 | pnp_unregister_card_driver(&cs423x_pnpc_driver); |
740 | #ifdef CS4232 | ||
741 | if (pnp_registered) | 729 | if (pnp_registered) |
742 | pnp_unregister_driver(&cs4232_pnp_driver); | 730 | pnp_unregister_driver(&cs423x_pnp_driver); |
743 | #endif | ||
744 | if (isa_registered) | 731 | if (isa_registered) |
745 | #endif | 732 | #endif |
746 | isa_unregister_driver(&cs423x_isa_driver); | 733 | isa_unregister_driver(&cs423x_isa_driver); |
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c index 2406efdfd8dd..38835f31298b 100644 --- a/sound/isa/cs423x/cs4236_lib.c +++ b/sound/isa/cs423x/cs4236_lib.c | |||
@@ -88,10 +88,6 @@ | |||
88 | #include <sound/wss.h> | 88 | #include <sound/wss.h> |
89 | #include <sound/asoundef.h> | 89 | #include <sound/asoundef.h> |
90 | 90 | ||
91 | MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>"); | ||
92 | MODULE_DESCRIPTION("Routines for control of CS4235/4236B/4237B/4238B/4239 chips"); | ||
93 | MODULE_LICENSE("GPL"); | ||
94 | |||
95 | /* | 91 | /* |
96 | * | 92 | * |
97 | */ | 93 | */ |
@@ -1022,23 +1018,3 @@ int snd_cs4236_mixer(struct snd_wss *chip) | |||
1022 | } | 1018 | } |
1023 | return 0; | 1019 | return 0; |
1024 | } | 1020 | } |
1025 | |||
1026 | EXPORT_SYMBOL(snd_cs4236_create); | ||
1027 | EXPORT_SYMBOL(snd_cs4236_pcm); | ||
1028 | EXPORT_SYMBOL(snd_cs4236_mixer); | ||
1029 | |||
1030 | /* | ||
1031 | * INIT part | ||
1032 | */ | ||
1033 | |||
1034 | static int __init alsa_cs4236_init(void) | ||
1035 | { | ||
1036 | return 0; | ||
1037 | } | ||
1038 | |||
1039 | static void __exit alsa_cs4236_exit(void) | ||
1040 | { | ||
1041 | } | ||
1042 | |||
1043 | module_init(alsa_cs4236_init) | ||
1044 | module_exit(alsa_cs4236_exit) | ||
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c index a0242c3b613e..80f5b1af9be8 100644 --- a/sound/isa/dt019x.c +++ b/sound/isa/dt019x.c | |||
@@ -150,9 +150,10 @@ static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, | |||
150 | struct snd_card_dt019x *acard; | 150 | struct snd_card_dt019x *acard; |
151 | struct snd_opl3 *opl3; | 151 | struct snd_opl3 *opl3; |
152 | 152 | ||
153 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 153 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
154 | sizeof(struct snd_card_dt019x))) == NULL) | 154 | sizeof(struct snd_card_dt019x), &card); |
155 | return -ENOMEM; | 155 | if (error < 0) |
156 | return error; | ||
156 | acard = card->private_data; | 157 | acard = card->private_data; |
157 | 158 | ||
158 | snd_card_set_dev(card, &pcard->card->dev); | 159 | snd_card_set_dev(card, &pcard->card->dev); |
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index b0eb0cf6050e..442b081cafb7 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c | |||
@@ -125,9 +125,9 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n) | |||
125 | struct snd_pcm *pcm; | 125 | struct snd_pcm *pcm; |
126 | int error; | 126 | int error; |
127 | 127 | ||
128 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 128 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
129 | if (!card) | 129 | if (error < 0) |
130 | return -EINVAL; | 130 | return error; |
131 | 131 | ||
132 | error = snd_es1688_legacy_create(card, dev, n, &chip); | 132 | error = snd_es1688_legacy_create(card, dev, n, &chip); |
133 | if (error < 0) | 133 | if (error < 0) |
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 90498e4ca260..8cfbff73a835 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -2125,10 +2125,10 @@ static int __devinit snd_audiodrive_pnpc(int dev, struct snd_audiodrive *acard, | |||
2125 | #define is_isapnp_selected(dev) 0 | 2125 | #define is_isapnp_selected(dev) 0 |
2126 | #endif | 2126 | #endif |
2127 | 2127 | ||
2128 | static struct snd_card *snd_es18xx_card_new(int dev) | 2128 | static int snd_es18xx_card_new(int dev, struct snd_card **cardp) |
2129 | { | 2129 | { |
2130 | return snd_card_new(index[dev], id[dev], THIS_MODULE, | 2130 | return snd_card_create(index[dev], id[dev], THIS_MODULE, |
2131 | sizeof(struct snd_audiodrive)); | 2131 | sizeof(struct snd_audiodrive), cardp); |
2132 | } | 2132 | } |
2133 | 2133 | ||
2134 | static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev) | 2134 | static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev) |
@@ -2197,9 +2197,9 @@ static int __devinit snd_es18xx_isa_probe1(int dev, struct device *devptr) | |||
2197 | struct snd_card *card; | 2197 | struct snd_card *card; |
2198 | int err; | 2198 | int err; |
2199 | 2199 | ||
2200 | card = snd_es18xx_card_new(dev); | 2200 | err = snd_es18xx_card_new(dev, &card); |
2201 | if (! card) | 2201 | if (err < 0) |
2202 | return -ENOMEM; | 2202 | return err; |
2203 | snd_card_set_dev(card, devptr); | 2203 | snd_card_set_dev(card, devptr); |
2204 | if ((err = snd_audiodrive_probe(card, dev)) < 0) { | 2204 | if ((err = snd_audiodrive_probe(card, dev)) < 0) { |
2205 | snd_card_free(card); | 2205 | snd_card_free(card); |
@@ -2303,9 +2303,9 @@ static int __devinit snd_audiodrive_pnp_detect(struct pnp_dev *pdev, | |||
2303 | if (dev >= SNDRV_CARDS) | 2303 | if (dev >= SNDRV_CARDS) |
2304 | return -ENODEV; | 2304 | return -ENODEV; |
2305 | 2305 | ||
2306 | card = snd_es18xx_card_new(dev); | 2306 | err = snd_es18xx_card_new(dev, &card); |
2307 | if (! card) | 2307 | if (err < 0) |
2308 | return -ENOMEM; | 2308 | return err; |
2309 | if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) { | 2309 | if ((err = snd_audiodrive_pnp(dev, card->private_data, pdev)) < 0) { |
2310 | snd_card_free(card); | 2310 | snd_card_free(card); |
2311 | return err; | 2311 | return err; |
@@ -2362,9 +2362,9 @@ static int __devinit snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard, | |||
2362 | if (dev >= SNDRV_CARDS) | 2362 | if (dev >= SNDRV_CARDS) |
2363 | return -ENODEV; | 2363 | return -ENODEV; |
2364 | 2364 | ||
2365 | card = snd_es18xx_card_new(dev); | 2365 | res = snd_es18xx_card_new(dev, &card); |
2366 | if (! card) | 2366 | if (res < 0) |
2367 | return -ENOMEM; | 2367 | return res; |
2368 | 2368 | ||
2369 | if ((res = snd_audiodrive_pnpc(dev, card->private_data, pcard, pid)) < 0) { | 2369 | if ((res = snd_audiodrive_pnpc(dev, card->private_data, pcard, pid)) < 0) { |
2370 | snd_card_free(card); | 2370 | snd_card_free(card); |
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index 426532a4d730..086b8f0e0f94 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c | |||
@@ -148,9 +148,9 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n) | |||
148 | struct snd_gus_card *gus; | 148 | struct snd_gus_card *gus; |
149 | int error; | 149 | int error; |
150 | 150 | ||
151 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 151 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
152 | if (!card) | 152 | if (error < 0) |
153 | return -EINVAL; | 153 | return error; |
154 | 154 | ||
155 | if (pcm_channels[n] < 2) | 155 | if (pcm_channels[n] < 2) |
156 | pcm_channels[n] = 2; | 156 | pcm_channels[n] = 2; |
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index 7ad4c3b41a84..180a8dea6bd9 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c | |||
@@ -241,9 +241,9 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n) | |||
241 | struct snd_opl3 *opl3; | 241 | struct snd_opl3 *opl3; |
242 | int error; | 242 | int error; |
243 | 243 | ||
244 | card = snd_card_new(index[n], id[n], THIS_MODULE, 0); | 244 | error = snd_card_create(index[n], id[n], THIS_MODULE, 0, &card); |
245 | if (!card) | 245 | if (error < 0) |
246 | return -EINVAL; | 246 | return error; |
247 | 247 | ||
248 | if (mpu_port[n] == SNDRV_AUTO_PORT) | 248 | if (mpu_port[n] == SNDRV_AUTO_PORT) |
249 | mpu_port[n] = 0; | 249 | mpu_port[n] = 0; |
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index f94c1976e632..f26eac8d8110 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c | |||
@@ -214,10 +214,10 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev) | |||
214 | struct snd_wss *wss; | 214 | struct snd_wss *wss; |
215 | struct snd_gusmax *maxcard; | 215 | struct snd_gusmax *maxcard; |
216 | 216 | ||
217 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 217 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
218 | sizeof(struct snd_gusmax)); | 218 | sizeof(struct snd_gusmax), &card); |
219 | if (card == NULL) | 219 | if (err < 0) |
220 | return -ENOMEM; | 220 | return err; |
221 | card->private_free = snd_gusmax_free; | 221 | card->private_free = snd_gusmax_free; |
222 | maxcard = (struct snd_gusmax *)card->private_data; | 222 | maxcard = (struct snd_gusmax *)card->private_data; |
223 | maxcard->card = card; | 223 | maxcard->card = card; |
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 418d49eef926..534a6eced2b8 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -628,20 +628,22 @@ static void snd_interwave_free(struct snd_card *card) | |||
628 | free_irq(iwcard->irq, (void *)iwcard); | 628 | free_irq(iwcard->irq, (void *)iwcard); |
629 | } | 629 | } |
630 | 630 | ||
631 | static struct snd_card *snd_interwave_card_new(int dev) | 631 | static int snd_interwave_card_new(int dev, struct snd_card **cardp) |
632 | { | 632 | { |
633 | struct snd_card *card; | 633 | struct snd_card *card; |
634 | struct snd_interwave *iwcard; | 634 | struct snd_interwave *iwcard; |
635 | int err; | ||
635 | 636 | ||
636 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 637 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
637 | sizeof(struct snd_interwave)); | 638 | sizeof(struct snd_interwave), &card); |
638 | if (card == NULL) | 639 | if (err < 0) |
639 | return NULL; | 640 | return err; |
640 | iwcard = card->private_data; | 641 | iwcard = card->private_data; |
641 | iwcard->card = card; | 642 | iwcard->card = card; |
642 | iwcard->irq = -1; | 643 | iwcard->irq = -1; |
643 | card->private_free = snd_interwave_free; | 644 | card->private_free = snd_interwave_free; |
644 | return card; | 645 | *cardp = card; |
646 | return 0; | ||
645 | } | 647 | } |
646 | 648 | ||
647 | static int __devinit snd_interwave_probe(struct snd_card *card, int dev) | 649 | static int __devinit snd_interwave_probe(struct snd_card *card, int dev) |
@@ -780,9 +782,9 @@ static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr) | |||
780 | struct snd_card *card; | 782 | struct snd_card *card; |
781 | int err; | 783 | int err; |
782 | 784 | ||
783 | card = snd_interwave_card_new(dev); | 785 | err = snd_interwave_card_new(dev, &card); |
784 | if (! card) | 786 | if (err < 0) |
785 | return -ENOMEM; | 787 | return err; |
786 | 788 | ||
787 | snd_card_set_dev(card, devptr); | 789 | snd_card_set_dev(card, devptr); |
788 | if ((err = snd_interwave_probe(card, dev)) < 0) { | 790 | if ((err = snd_interwave_probe(card, dev)) < 0) { |
@@ -878,9 +880,9 @@ static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard, | |||
878 | if (dev >= SNDRV_CARDS) | 880 | if (dev >= SNDRV_CARDS) |
879 | return -ENODEV; | 881 | return -ENODEV; |
880 | 882 | ||
881 | card = snd_interwave_card_new(dev); | 883 | res = snd_interwave_card_new(dev, &card); |
882 | if (! card) | 884 | if (res < 0) |
883 | return -ENOMEM; | 885 | return res; |
884 | 886 | ||
885 | if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { | 887 | if ((res = snd_interwave_pnp(dev, card->private_data, pcard, pid)) < 0) { |
886 | snd_card_free(card); | 888 | snd_card_free(card); |
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 3f0b877bc8b5..ef95279da7a3 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -627,21 +627,24 @@ static void snd_opl3sa2_free(struct snd_card *card) | |||
627 | release_and_free_resource(chip->res_port); | 627 | release_and_free_resource(chip->res_port); |
628 | } | 628 | } |
629 | 629 | ||
630 | static struct snd_card *snd_opl3sa2_card_new(int dev) | 630 | static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp) |
631 | { | 631 | { |
632 | struct snd_card *card; | 632 | struct snd_card *card; |
633 | struct snd_opl3sa2 *chip; | 633 | struct snd_opl3sa2 *chip; |
634 | int err; | ||
634 | 635 | ||
635 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_opl3sa2)); | 636 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
636 | if (card == NULL) | 637 | sizeof(struct snd_opl3sa2), &card); |
637 | return NULL; | 638 | if (err < 0) |
639 | return err; | ||
638 | strcpy(card->driver, "OPL3SA2"); | 640 | strcpy(card->driver, "OPL3SA2"); |
639 | strcpy(card->shortname, "Yamaha OPL3-SA"); | 641 | strcpy(card->shortname, "Yamaha OPL3-SA"); |
640 | chip = card->private_data; | 642 | chip = card->private_data; |
641 | spin_lock_init(&chip->reg_lock); | 643 | spin_lock_init(&chip->reg_lock); |
642 | chip->irq = -1; | 644 | chip->irq = -1; |
643 | card->private_free = snd_opl3sa2_free; | 645 | card->private_free = snd_opl3sa2_free; |
644 | return card; | 646 | *cardp = card; |
647 | return 0; | ||
645 | } | 648 | } |
646 | 649 | ||
647 | static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev) | 650 | static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev) |
@@ -733,9 +736,9 @@ static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev, | |||
733 | if (dev >= SNDRV_CARDS) | 736 | if (dev >= SNDRV_CARDS) |
734 | return -ENODEV; | 737 | return -ENODEV; |
735 | 738 | ||
736 | card = snd_opl3sa2_card_new(dev); | 739 | err = snd_opl3sa2_card_new(dev, &card); |
737 | if (! card) | 740 | if (err < 0) |
738 | return -ENOMEM; | 741 | return err; |
739 | if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { | 742 | if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { |
740 | snd_card_free(card); | 743 | snd_card_free(card); |
741 | return err; | 744 | return err; |
@@ -799,9 +802,9 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard, | |||
799 | if (dev >= SNDRV_CARDS) | 802 | if (dev >= SNDRV_CARDS) |
800 | return -ENODEV; | 803 | return -ENODEV; |
801 | 804 | ||
802 | card = snd_opl3sa2_card_new(dev); | 805 | err = snd_opl3sa2_card_new(dev, &card); |
803 | if (! card) | 806 | if (err < 0) |
804 | return -ENOMEM; | 807 | return err; |
805 | if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { | 808 | if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) { |
806 | snd_card_free(card); | 809 | snd_card_free(card); |
807 | return err; | 810 | return err; |
@@ -880,9 +883,9 @@ static int __devinit snd_opl3sa2_isa_probe(struct device *pdev, | |||
880 | struct snd_card *card; | 883 | struct snd_card *card; |
881 | int err; | 884 | int err; |
882 | 885 | ||
883 | card = snd_opl3sa2_card_new(dev); | 886 | err = snd_opl3sa2_card_new(dev, &card); |
884 | if (! card) | 887 | if (err < 0) |
885 | return -ENOMEM; | 888 | return err; |
886 | snd_card_set_dev(card, pdev); | 889 | snd_card_set_dev(card, pdev); |
887 | if ((err = snd_opl3sa2_probe(card, dev)) < 0) { | 890 | if ((err = snd_opl3sa2_probe(card, dev)) < 0) { |
888 | snd_card_free(card); | 891 | snd_card_free(card); |
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c index 440755cc0013..02e30d7c6a93 100644 --- a/sound/isa/opti9xx/miro.c +++ b/sound/isa/opti9xx/miro.c | |||
@@ -1228,9 +1228,10 @@ static int __devinit snd_miro_probe(struct device *devptr, unsigned int n) | |||
1228 | struct snd_pcm *pcm; | 1228 | struct snd_pcm *pcm; |
1229 | struct snd_rawmidi *rmidi; | 1229 | struct snd_rawmidi *rmidi; |
1230 | 1230 | ||
1231 | if (!(card = snd_card_new(index, id, THIS_MODULE, | 1231 | error = snd_card_create(index, id, THIS_MODULE, |
1232 | sizeof(struct snd_miro)))) | 1232 | sizeof(struct snd_miro), &card); |
1233 | return -ENOMEM; | 1233 | if (error < 0) |
1234 | return error; | ||
1234 | 1235 | ||
1235 | card->private_free = snd_card_miro_free; | 1236 | card->private_free = snd_card_miro_free; |
1236 | miro = card->private_data; | 1237 | miro = card->private_data; |
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index d5bc0e03132a..5cd555325b9d 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -828,15 +828,18 @@ static int __devinit snd_opti9xx_probe(struct snd_card *card) | |||
828 | return snd_card_register(card); | 828 | return snd_card_register(card); |
829 | } | 829 | } |
830 | 830 | ||
831 | static struct snd_card *snd_opti9xx_card_new(void) | 831 | static int snd_opti9xx_card_new(struct snd_card **cardp) |
832 | { | 832 | { |
833 | struct snd_card *card; | 833 | struct snd_card *card; |
834 | int err; | ||
834 | 835 | ||
835 | card = snd_card_new(index, id, THIS_MODULE, sizeof(struct snd_opti9xx)); | 836 | err = snd_card_create(index, id, THIS_MODULE, |
836 | if (! card) | 837 | sizeof(struct snd_opti9xx), &card); |
837 | return NULL; | 838 | if (err < 0) |
839 | return err; | ||
838 | card->private_free = snd_card_opti9xx_free; | 840 | card->private_free = snd_card_opti9xx_free; |
839 | return card; | 841 | *cardp = card; |
842 | return 0; | ||
840 | } | 843 | } |
841 | 844 | ||
842 | static int __devinit snd_opti9xx_isa_match(struct device *devptr, | 845 | static int __devinit snd_opti9xx_isa_match(struct device *devptr, |
@@ -901,9 +904,9 @@ static int __devinit snd_opti9xx_isa_probe(struct device *devptr, | |||
901 | } | 904 | } |
902 | #endif | 905 | #endif |
903 | 906 | ||
904 | card = snd_opti9xx_card_new(); | 907 | error = snd_opti9xx_card_new(&card); |
905 | if (! card) | 908 | if (error < 0) |
906 | return -ENOMEM; | 909 | return error; |
907 | 910 | ||
908 | if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) { | 911 | if ((error = snd_card_opti9xx_detect(card, card->private_data)) < 0) { |
909 | snd_card_free(card); | 912 | snd_card_free(card); |
@@ -948,9 +951,9 @@ static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard, | |||
948 | return -EBUSY; | 951 | return -EBUSY; |
949 | if (! isapnp) | 952 | if (! isapnp) |
950 | return -ENODEV; | 953 | return -ENODEV; |
951 | card = snd_opti9xx_card_new(); | 954 | error = snd_opti9xx_card_new(&card); |
952 | if (! card) | 955 | if (error < 0) |
953 | return -ENOMEM; | 956 | return error; |
954 | chip = card->private_data; | 957 | chip = card->private_data; |
955 | 958 | ||
956 | hw = snd_card_opti9xx_pnp(chip, pcard, pid); | 959 | hw = snd_card_opti9xx_pnp(chip, pcard, pid); |
diff --git a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c index c8c8e214c843..cafc3a7316a8 100644 --- a/sound/isa/sb/es968.c +++ b/sound/isa/sb/es968.c | |||
@@ -108,9 +108,10 @@ static int __devinit snd_card_es968_probe(int dev, | |||
108 | struct snd_card *card; | 108 | struct snd_card *card; |
109 | struct snd_card_es968 *acard; | 109 | struct snd_card_es968 *acard; |
110 | 110 | ||
111 | if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 111 | error = snd_card_create(index[dev], id[dev], THIS_MODULE, |
112 | sizeof(struct snd_card_es968))) == NULL) | 112 | sizeof(struct snd_card_es968), &card); |
113 | return -ENOMEM; | 113 | if (error < 0) |
114 | return error; | ||
114 | acard = card->private_data; | 115 | acard = card->private_data; |
115 | if ((error = snd_card_es968_pnp(dev, acard, pcard, pid))) { | 116 | if ((error = snd_card_es968_pnp(dev, acard, pcard, pid))) { |
116 | snd_card_free(card); | 117 | snd_card_free(card); |
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 2c201f78ce50..519c36346dec 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c | |||
@@ -324,14 +324,18 @@ static void snd_sb16_free(struct snd_card *card) | |||
324 | #define is_isapnp_selected(dev) 0 | 324 | #define is_isapnp_selected(dev) 0 |
325 | #endif | 325 | #endif |
326 | 326 | ||
327 | static struct snd_card *snd_sb16_card_new(int dev) | 327 | static int snd_sb16_card_new(int dev, struct snd_card **cardp) |
328 | { | 328 | { |
329 | struct snd_card *card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 329 | struct snd_card *card; |
330 | sizeof(struct snd_card_sb16)); | 330 | int err; |
331 | if (card == NULL) | 331 | |
332 | return NULL; | 332 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
333 | sizeof(struct snd_card_sb16), &card); | ||
334 | if (err < 0) | ||
335 | return err; | ||
333 | card->private_free = snd_sb16_free; | 336 | card->private_free = snd_sb16_free; |
334 | return card; | 337 | *cardp = card; |
338 | return 0; | ||
335 | } | 339 | } |
336 | 340 | ||
337 | static int __devinit snd_sb16_probe(struct snd_card *card, int dev) | 341 | static int __devinit snd_sb16_probe(struct snd_card *card, int dev) |
@@ -489,9 +493,9 @@ static int __devinit snd_sb16_isa_probe1(int dev, struct device *pdev) | |||
489 | struct snd_card *card; | 493 | struct snd_card *card; |
490 | int err; | 494 | int err; |
491 | 495 | ||
492 | card = snd_sb16_card_new(dev); | 496 | err = snd_sb16_card_new(dev, &card); |
493 | if (! card) | 497 | if (err < 0) |
494 | return -ENOMEM; | 498 | return err; |
495 | 499 | ||
496 | acard = card->private_data; | 500 | acard = card->private_data; |
497 | /* non-PnP FM port address is hardwired with base port address */ | 501 | /* non-PnP FM port address is hardwired with base port address */ |
@@ -610,9 +614,9 @@ static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard, | |||
610 | for ( ; dev < SNDRV_CARDS; dev++) { | 614 | for ( ; dev < SNDRV_CARDS; dev++) { |
611 | if (!enable[dev] || !isapnp[dev]) | 615 | if (!enable[dev] || !isapnp[dev]) |
612 | continue; | 616 | continue; |
613 | card = snd_sb16_card_new(dev); | 617 | res = snd_sb16_card_new(dev, &card); |
614 | if (! card) | 618 | if (res < 0) |
615 | return -ENOMEM; | 619 | return res; |
616 | snd_card_set_dev(card, &pcard->card->dev); | 620 | snd_card_set_dev(card, &pcard->card->dev); |
617 | if ((res = snd_card_sb16_pnp(dev, card->private_data, pcard, pid)) < 0 || | 621 | if ((res = snd_card_sb16_pnp(dev, card->private_data, pcard, pid)) < 0 || |
618 | (res = snd_sb16_probe(card, dev)) < 0) { | 622 | (res = snd_sb16_probe(card, dev)) < 0) { |
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index ea06877be4b1..3cd57ee54660 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c | |||
@@ -103,10 +103,10 @@ static int __devinit snd_sb8_probe(struct device *pdev, unsigned int dev) | |||
103 | struct snd_opl3 *opl3; | 103 | struct snd_opl3 *opl3; |
104 | int err; | 104 | int err; |
105 | 105 | ||
106 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 106 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
107 | sizeof(struct snd_sb8)); | 107 | sizeof(struct snd_sb8), &card); |
108 | if (card == NULL) | 108 | if (err < 0) |
109 | return -ENOMEM; | 109 | return err; |
110 | acard = card->private_data; | 110 | acard = card->private_data; |
111 | card->private_free = snd_sb8_free; | 111 | card->private_free = snd_sb8_free; |
112 | 112 | ||
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c index bbc53692e68d..782010608ef4 100644 --- a/sound/isa/sc6000.c +++ b/sound/isa/sc6000.c | |||
@@ -489,9 +489,9 @@ static int __devinit snd_sc6000_probe(struct device *devptr, unsigned int dev) | |||
489 | char __iomem *vmss_port; | 489 | char __iomem *vmss_port; |
490 | 490 | ||
491 | 491 | ||
492 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); | 492 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); |
493 | if (!card) | 493 | if (err < 0) |
494 | return -ENOMEM; | 494 | return err; |
495 | 495 | ||
496 | if (xirq == SNDRV_AUTO_IRQ) { | 496 | if (xirq == SNDRV_AUTO_IRQ) { |
497 | xirq = snd_legacy_find_free_irq(possible_irqs); | 497 | xirq = snd_legacy_find_free_irq(possible_irqs); |
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c index 2c7503bf1271..6fe27b9d9440 100644 --- a/sound/isa/sgalaxy.c +++ b/sound/isa/sgalaxy.c | |||
@@ -243,9 +243,9 @@ static int __devinit snd_sgalaxy_probe(struct device *devptr, unsigned int dev) | |||
243 | struct snd_card *card; | 243 | struct snd_card *card; |
244 | struct snd_wss *chip; | 244 | struct snd_wss *chip; |
245 | 245 | ||
246 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); | 246 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); |
247 | if (card == NULL) | 247 | if (err < 0) |
248 | return -ENOMEM; | 248 | return err; |
249 | 249 | ||
250 | xirq = irq[dev]; | 250 | xirq = irq[dev]; |
251 | if (xirq == SNDRV_AUTO_IRQ) { | 251 | if (xirq == SNDRV_AUTO_IRQ) { |
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 48a16d865834..4025fb558c50 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c | |||
@@ -1357,10 +1357,10 @@ static int __devinit snd_sscape_probe(struct device *pdev, unsigned int dev) | |||
1357 | struct soundscape *sscape; | 1357 | struct soundscape *sscape; |
1358 | int ret; | 1358 | int ret; |
1359 | 1359 | ||
1360 | card = snd_card_new(index[dev], id[dev], THIS_MODULE, | 1360 | ret = snd_card_create(index[dev], id[dev], THIS_MODULE, |
1361 | sizeof(struct soundscape)); | 1361 | sizeof(struct soundscape), &card); |
1362 | if (!card) | 1362 | if (ret < 0) |
1363 | return -ENOMEM; | 1363 | return ret; |
1364 | 1364 | ||
1365 | sscape = get_card_soundscape(card); | 1365 | sscape = get_card_soundscape(card); |
1366 | sscape->type = SSCAPE; | 1366 | sscape->type = SSCAPE; |
@@ -1462,10 +1462,10 @@ static int __devinit sscape_pnp_detect(struct pnp_card_link *pcard, | |||
1462 | * Create a new ALSA sound card entry, in anticipation | 1462 | * Create a new ALSA sound card entry, in anticipation |
1463 | * of detecting our hardware ... | 1463 | * of detecting our hardware ... |
1464 | */ | 1464 | */ |
1465 | card = snd_card_new(index[idx], id[idx], THIS_MODULE, | 1465 | ret = snd_card_create(index[idx], id[idx], THIS_MODULE, |
1466 | sizeof(struct soundscape)); | 1466 | sizeof(struct soundscape), &card); |
1467 | if (!card) | 1467 | if (ret < 0) |
1468 | return -ENOMEM; | 1468 | return ret; |
1469 | 1469 | ||
1470 | sscape = get_card_soundscape(card); | 1470 | sscape = get_card_soundscape(card); |
1471 | 1471 | ||
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index c280e6220aee..a34ae7b1f7d0 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -338,15 +338,16 @@ snd_wavefront_free(struct snd_card *card) | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | static struct snd_card *snd_wavefront_card_new(int dev) | 341 | static int snd_wavefront_card_new(int dev, struct snd_card **cardp) |
342 | { | 342 | { |
343 | struct snd_card *card; | 343 | struct snd_card *card; |
344 | snd_wavefront_card_t *acard; | 344 | snd_wavefront_card_t *acard; |
345 | int err; | ||
345 | 346 | ||
346 | card = snd_card_new (index[dev], id[dev], THIS_MODULE, | 347 | err = snd_card_create(index[dev], id[dev], THIS_MODULE, |
347 | sizeof(snd_wavefront_card_t)); | 348 | sizeof(snd_wavefront_card_t), &card); |
348 | if (card == NULL) | 349 | if (err < 0) |
349 | return NULL; | 350 | return err; |
350 | 351 | ||
351 | acard = card->private_data; | 352 | acard = card->private_data; |
352 | acard->wavefront.irq = -1; | 353 | acard->wavefront.irq = -1; |
@@ -357,7 +358,8 @@ static struct snd_card *snd_wavefront_card_new(int dev) | |||
357 | acard->wavefront.card = card; | 358 | acard->wavefront.card = card; |
358 | card->private_free = snd_wavefront_free; | 359 | card->private_free = snd_wavefront_free; |
359 | 360 | ||
360 | return card; | 361 | *cardp = card; |
362 | return 0; | ||
361 | } | 363 | } |
362 | 364 | ||
363 | static int __devinit | 365 | static int __devinit |
@@ -567,9 +569,9 @@ static int __devinit snd_wavefront_isa_probe(struct device *pdev, | |||
567 | struct snd_card *card; | 569 | struct snd_card *card; |
568 | int err; | 570 | int err; |
569 | 571 | ||
570 | card = snd_wavefront_card_new(dev); | 572 | err = snd_wavefront_card_new(dev, &card); |
571 | if (! card) | 573 | if (err < 0) |
572 | return -ENOMEM; | 574 | return err; |
573 | snd_card_set_dev(card, pdev); | 575 | snd_card_set_dev(card, pdev); |
574 | if ((err = snd_wavefront_probe(card, dev)) < 0) { | 576 | if ((err = snd_wavefront_probe(card, dev)) < 0) { |
575 | snd_card_free(card); | 577 | snd_card_free(card); |
@@ -616,9 +618,9 @@ static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard, | |||
616 | if (dev >= SNDRV_CARDS) | 618 | if (dev >= SNDRV_CARDS) |
617 | return -ENODEV; | 619 | return -ENODEV; |
618 | 620 | ||
619 | card = snd_wavefront_card_new(dev); | 621 | res = snd_wavefront_card_new(dev, &card); |
620 | if (! card) | 622 | if (res < 0) |
621 | return -ENOMEM; | 623 | return res; |
622 | 624 | ||
623 | if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) { | 625 | if (snd_wavefront_pnp (dev, card->private_data, pcard, pid) < 0) { |
624 | if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) { | 626 | if (cs4232_pcm_port[dev] == SNDRV_AUTO_PORT) { |
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 8de5deda7ad6..ac27832b2c6f 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c | |||
@@ -1657,7 +1657,7 @@ static void snd_wss_resume(struct snd_wss *chip) | |||
1657 | } | 1657 | } |
1658 | #endif /* CONFIG_PM */ | 1658 | #endif /* CONFIG_PM */ |
1659 | 1659 | ||
1660 | static int snd_wss_free(struct snd_wss *chip) | 1660 | int snd_wss_free(struct snd_wss *chip) |
1661 | { | 1661 | { |
1662 | release_and_free_resource(chip->res_port); | 1662 | release_and_free_resource(chip->res_port); |
1663 | release_and_free_resource(chip->res_cport); | 1663 | release_and_free_resource(chip->res_cport); |
@@ -1680,6 +1680,7 @@ static int snd_wss_free(struct snd_wss *chip) | |||
1680 | kfree(chip); | 1680 | kfree(chip); |
1681 | return 0; | 1681 | return 0; |
1682 | } | 1682 | } |
1683 | EXPORT_SYMBOL(snd_wss_free); | ||
1683 | 1684 | ||
1684 | static int snd_wss_dev_free(struct snd_device *device) | 1685 | static int snd_wss_dev_free(struct snd_device *device) |
1685 | { | 1686 | { |