diff options
Diffstat (limited to 'sound/isa/dt019x.c')
-rw-r--r-- | sound/isa/dt019x.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/isa/dt019x.c b/sound/isa/dt019x.c index 50e7bc5ef561..0acb4e5da47f 100644 --- a/sound/isa/dt019x.c +++ b/sound/isa/dt019x.c | |||
@@ -272,6 +272,8 @@ static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, | |||
272 | return 0; | 272 | return 0; |
273 | } | 273 | } |
274 | 274 | ||
275 | static unsigned int __devinitdata dt019x_devices; | ||
276 | |||
275 | static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card, | 277 | static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card, |
276 | const struct pnp_card_device_id *pid) | 278 | const struct pnp_card_device_id *pid) |
277 | { | 279 | { |
@@ -285,6 +287,7 @@ static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card, | |||
285 | if (res < 0) | 287 | if (res < 0) |
286 | return res; | 288 | return res; |
287 | dev++; | 289 | dev++; |
290 | dt019x_devices++; | ||
288 | return 0; | 291 | return 0; |
289 | } | 292 | } |
290 | return -ENODEV; | 293 | return -ENODEV; |
@@ -336,10 +339,13 @@ static struct pnp_card_driver dt019x_pnpc_driver = { | |||
336 | 339 | ||
337 | static int __init alsa_card_dt019x_init(void) | 340 | static int __init alsa_card_dt019x_init(void) |
338 | { | 341 | { |
339 | int cards = 0; | 342 | int err; |
343 | |||
344 | err = pnp_register_card_driver(&dt019x_pnpc_driver); | ||
345 | if (err) | ||
346 | return err; | ||
340 | 347 | ||
341 | cards = pnp_register_card_driver(&dt019x_pnpc_driver); | 348 | if (!dt019x_devices) { |
342 | if (cards <= 0) { | ||
343 | pnp_unregister_card_driver(&dt019x_pnpc_driver); | 349 | pnp_unregister_card_driver(&dt019x_pnpc_driver); |
344 | #ifdef MODULE | 350 | #ifdef MODULE |
345 | snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n"); | 351 | snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n"); |