linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / sound / oss / cs4232.c
index b6924c7..7c59e2d 100644 (file)
@@ -47,6 +47,7 @@
  *     Marcus Meissner         Added ISA PnP support.
  */
 
+#include <linux/config.h>
 #include <linux/pnp.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -359,8 +360,6 @@ static int __initdata synthio       = -1;
 static int __initdata synthirq = -1;
 static int __initdata isapnp   = 1;
 
-static unsigned int cs4232_devices;
-
 MODULE_DESCRIPTION("CS4232 based soundcard driver"); 
 MODULE_AUTHOR("Hannu Savolainen, Paul Barton-Davis"); 
 MODULE_LICENSE("GPL");
@@ -404,7 +403,7 @@ static const struct pnp_device_id cs4232_pnp_table[] = {
 
 MODULE_DEVICE_TABLE(pnp, cs4232_pnp_table);
 
-static int __init cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
+static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 {
        struct address_info *isapnpcfg;
 
@@ -422,7 +421,6 @@ static int __init cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_
                return -ENODEV;
        }
        pnp_set_drvdata(dev,isapnpcfg);
-       cs4232_devices++;
        return 0;
 }
 
@@ -457,11 +455,10 @@ static int __init init_cs4232(void)
 #endif
        cfg.irq = -1;
 
-       if (isapnp) {
-               pnp_register_driver(&cs4232_driver);
-               if (cs4232_devices)
-                       return 0;
-       }
+       if (isapnp &&
+           (pnp_register_driver(&cs4232_driver) > 0)
+       )
+               return 0;
 
        if(io==-1||irq==-1||dma==-1)
        {
@@ -506,8 +503,7 @@ static int __init setup_cs4232(char *str)
        int ints[7];
 
        /* If we have isapnp cards, no need for options */
-       pnp_register_driver(&cs4232_driver);
-       if (cs4232_devices)
+       if (pnp_register_driver(&cs4232_driver) > 0)
                return 1;
        
        str = get_options(str, ARRAY_SIZE(ints), ints);