[OSS] Unregister driver if probing fails in SB

From: Herbert Xu
Date: Sat Nov 08 2003 - 23:21:52 EST


Hi:

This patch adds a missing unregister when probing fails in the
OSS SoundBlaster driver.

Cheers,
--
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Index: kernel-source-2.5/sound/oss/sb_card.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/sound/oss/sb_card.c,v
retrieving revision 1.1.1.6
retrieving revision 1.3
diff -u -r1.1.1.6 -r1.3
--- kernel-source-2.5/sound/oss/sb_card.c 22 Aug 2003 23:57:18 -0000 1.1.1.6
+++ kernel-source-2.5/sound/oss/sb_card.c 9 Nov 2003 04:12:55 -0000 1.3
@@ -302,7 +302,13 @@

/* If either PnP or Legacy registered a card then return
* success */
- return (pres > 0 || lres > 0) ? 0 : -ENODEV;
+ if (pres <= 0 && lres <= 0) {
+#ifdef CONFIG_PNP
+ pnp_unregister_card_driver(&sb_pnp_driver);
+#endif
+ return -ENODEV;
+ }
+ return 0;
}

static void __exit sb_exit(void)