Pull osi into release branch
[sfrench/cifs-2.6.git] / sound / core / sound.c
index 82a61c67cf3ae6a027bdd082ca11f56f87960b05..8dc7a3b32b98482bc12f1b60aa6cb25352d41bf3 100644 (file)
@@ -168,7 +168,7 @@ static int snd_open(struct inode *inode, struct file *file)
        return err;
 }
 
-static struct file_operations snd_fops =
+static const struct file_operations snd_fops =
 {
        .owner =        THIS_MODULE,
        .open =         snd_open
@@ -219,26 +219,27 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev)
 #endif
 
 /**
- * snd_register_device - Register the ALSA device file for the card
+ * snd_register_device_for_dev - Register the ALSA device file for the card
  * @type: the device type, SNDRV_DEVICE_TYPE_XXX
  * @card: the card instance
  * @dev: the device index
  * @f_ops: the file operations
  * @private_data: user pointer for f_ops->open()
  * @name: the device file name
+ * @device: the &struct device to link this new device to
  *
  * Registers an ALSA device file for the given card.
  * The operators have to be set in reg parameter.
  *
- * Retrurns zero if successful, or a negative error code on failure.
+ * Returns zero if successful, or a negative error code on failure.
  */
-int snd_register_device(int type, struct snd_card *card, int dev,
-                       const struct file_operations *f_ops, void *private_data,
-                       const char *name)
+int snd_register_device_for_dev(int type, struct snd_card *card, int dev,
+                               const struct file_operations *f_ops,
+                               void *private_data,
+                               const char *name, struct device *device)
 {
        int minor;
        struct snd_minor *preg;
-       struct device *device = snd_card_get_device_link(card);
 
        snd_assert(name, return -EINVAL);
        preg = kmalloc(sizeof *preg, GFP_KERNEL);
@@ -272,7 +273,7 @@ int snd_register_device(int type, struct snd_card *card, int dev,
        return 0;
 }
 
-EXPORT_SYMBOL(snd_register_device);
+EXPORT_SYMBOL(snd_register_device_for_dev);
 
 /* find the matching minor record
  * return the index of snd_minor, or -1 if not found
@@ -445,8 +446,7 @@ static void __exit alsa_sound_exit(void)
 {
        snd_info_minor_unregister();
        snd_info_done();
-       if (unregister_chrdev(major, "alsa") != 0)
-               snd_printk(KERN_ERR "unable to unregister major device number %d\n", major);
+       unregister_chrdev(major, "alsa");
 }
 
 module_init(alsa_sound_init)