diff options
Diffstat (limited to 'sound/isa/ad1816a/ad1816a.c')
-rw-r--r-- | sound/isa/ad1816a/ad1816a.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c index 7051f7798ed7..31f299aed281 100644 --- a/sound/isa/ad1816a/ad1816a.c +++ b/sound/isa/ad1816a/ad1816a.c | |||
@@ -262,6 +262,8 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard | |||
262 | return 0; | 262 | return 0; |
263 | } | 263 | } |
264 | 264 | ||
265 | static unsigned int __devinitdata ad1816a_devices; | ||
266 | |||
265 | static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card, | 267 | static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card, |
266 | const struct pnp_card_device_id *id) | 268 | const struct pnp_card_device_id *id) |
267 | { | 269 | { |
@@ -275,6 +277,7 @@ static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card, | |||
275 | if (res < 0) | 277 | if (res < 0) |
276 | return res; | 278 | return res; |
277 | dev++; | 279 | dev++; |
280 | ad1816a_devices++; | ||
278 | return 0; | 281 | return 0; |
279 | } | 282 | } |
280 | return -ENODEV; | 283 | return -ENODEV; |
@@ -297,10 +300,13 @@ static struct pnp_card_driver ad1816a_pnpc_driver = { | |||
297 | 300 | ||
298 | static int __init alsa_card_ad1816a_init(void) | 301 | static int __init alsa_card_ad1816a_init(void) |
299 | { | 302 | { |
300 | int cards; | 303 | int err; |
304 | |||
305 | err = pnp_register_card_driver(&ad1816a_pnpc_driver); | ||
306 | if (err) | ||
307 | return err; | ||
301 | 308 | ||
302 | cards = pnp_register_card_driver(&ad1816a_pnpc_driver); | 309 | if (!ad1816a_devices) { |
303 | if (cards <= 0) { | ||
304 | pnp_unregister_card_driver(&ad1816a_pnpc_driver); | 310 | pnp_unregister_card_driver(&ad1816a_pnpc_driver); |
305 | #ifdef MODULE | 311 | #ifdef MODULE |
306 | printk(KERN_ERR "no AD1816A based soundcards found.\n"); | 312 | printk(KERN_ERR "no AD1816A based soundcards found.\n"); |