]> err.no Git - linux-2.6/blobdiff - sound/arm/sa11xx-uda1341.c
[PATCH] zd1211rw: Add ID for ZyXEL ZyAIR G-220 v2
[linux-2.6] / sound / arm / sa11xx-uda1341.c
index 3c342c1a7c80620d97d362b7c36ef45194ae39be..c7e1b26461938eea09e0381fd0e83e213219fb4f 100644 (file)
@@ -21,7 +21,7 @@
  *                              merged HAL layer (patches from Brian)
  */
 
-/* $Id: sa11xx-uda1341.c,v 1.26 2005/11/17 17:19:50 tiwai Exp $ */
+/* $Id: sa11xx-uda1341.c,v 1.27 2005/12/07 09:13:42 cladisch Exp $ */
 
 /***************************************************************************************************
 *
@@ -59,7 +59,6 @@
 * 
 ***************************************************************************************************/
 
-#include <linux/config.h>
 #include <sound/driver.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -112,7 +111,7 @@ MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("SA1100/SA1111 + UDA1341TS driver for ALSA");
 MODULE_SUPPORTED_DEVICE("{{UDA1341,iPAQ H3600 UDA1341TS}}");
 
-static char *id = NULL;        /* ID for this card */
+static char *id;       /* ID for this card */
 
 module_param(id, charp, 0444);
 MODULE_PARM_DESC(id, "ID string for SA1100/SA1111 + UDA1341TS soundcard.");
@@ -126,7 +125,7 @@ struct audio_stream {
 #else
        dma_regs_t *dma_regs;   /* points to our DMA registers */
 #endif
-       int active:1;           /* we are using this stream for transfer now */
+       unsigned int active:1;  /* we are using this stream for transfer now */
        int period;             /* current transfer period */
        int periods;            /* current count of periods registerd in the DMA engine */
        int tx_spin;            /* are we recoding - flag used to do DMA trans. for sync */
@@ -155,6 +154,8 @@ static struct snd_pcm_hw_constraint_list hw_constraints_rates = {
        .mask   = 0,
 };
 
+static struct platform_device *device;
+
 /* }}} */
 
 /* {{{ Clock and sample rate stuff */
@@ -976,22 +977,26 @@ static struct platform_driver sa11xx_uda1341_driver = {
 static int __init sa11xx_uda1341_init(void)
 {
        int err;
-       struct platform_device *device;
 
        if (!machine_is_h3xxx())
                return -ENODEV;
        if ((err = platform_driver_register(&sa11xx_uda1341_driver)) < 0)
                return err;
        device = platform_device_register_simple(SA11XX_UDA1341_DRIVER, -1, NULL, 0);
-       if (IS_ERR(device)) {
-               platform_driver_unregister(&sa11xx_uda1341_driver);
-               return PTR_ERR(device);
-       }
-       return 0;
+       if (!IS_ERR(device)) {
+               if (platform_get_drvdata(device))
+                       return 0;
+               platform_device_unregister(device);
+               err = -ENODEV
+       } else
+               err = PTR_ERR(device);
+       platform_driver_unregister(&sa11xx_uda1341_driver);
+       return err;
 }
 
 static void __exit sa11xx_uda1341_exit(void)
 {
+       platform_device_unregister(device);
        platform_driver_unregister(&sa11xx_uda1341_driver);
 }