Pull icc-cleanup into release branch
[pandora-kernel.git] / sound / core / info.c
index ec3282f..af123e3 100644 (file)
@@ -37,6 +37,8 @@
  *
  */
 
+#ifdef CONFIG_PROC_FS
+
 int snd_info_check_reserved_words(const char *str)
 {
        static char *reserved[] =
@@ -66,8 +68,6 @@ int snd_info_check_reserved_words(const char *str)
        return 1;
 }
 
-#ifdef CONFIG_PROC_FS
-
 static DECLARE_MUTEX(info_mutex);
 
 struct snd_info_private_data {
@@ -444,8 +444,8 @@ static unsigned int snd_info_entry_poll(struct file *file, poll_table * wait)
        return mask;
 }
 
-static inline int _snd_info_entry_ioctl(struct inode *inode, struct file *file,
-                                       unsigned int cmd, unsigned long arg)
+static long snd_info_entry_ioctl(struct file *file, unsigned int cmd,
+                               unsigned long arg)
 {
        struct snd_info_private_data *data;
        struct snd_info_entry *entry;
@@ -465,17 +465,6 @@ static inline int _snd_info_entry_ioctl(struct inode *inode, struct file *file,
        return -ENOTTY;
 }
 
-/* FIXME: need to unlock BKL to allow preemption */
-static int snd_info_entry_ioctl(struct inode *inode, struct file *file,
-                               unsigned int cmd, unsigned long arg)
-{
-       int err;
-       unlock_kernel();
-       err = _snd_info_entry_ioctl(inode, file, cmd, arg);
-       lock_kernel();
-       return err;
-}
-
 static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma)
 {
        struct inode *inode = file->f_dentry->d_inode;
@@ -499,15 +488,15 @@ static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma)
 
 static struct file_operations snd_info_entry_operations =
 {
-       .owner =        THIS_MODULE,
-       .llseek =       snd_info_entry_llseek,
-       .read =         snd_info_entry_read,
-       .write =        snd_info_entry_write,
-       .poll =         snd_info_entry_poll,
-       .ioctl =        snd_info_entry_ioctl,
-       .mmap =         snd_info_entry_mmap,
-       .open =         snd_info_entry_open,
-       .release =      snd_info_entry_release,
+       .owner =                THIS_MODULE,
+       .llseek =               snd_info_entry_llseek,
+       .read =                 snd_info_entry_read,
+       .write =                snd_info_entry_write,
+       .poll =                 snd_info_entry_poll,
+       .unlocked_ioctl =       snd_info_entry_ioctl,
+       .mmap =                 snd_info_entry_mmap,
+       .open =                 snd_info_entry_open,
+       .release =              snd_info_entry_release,
 };
 
 /**
@@ -580,12 +569,10 @@ int __exit snd_info_done(void)
        snd_info_version_done();
        if (snd_proc_root) {
 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
-               if (snd_seq_root)
-                       snd_info_unregister(snd_seq_root);
+               snd_info_unregister(snd_seq_root);
 #endif
 #ifdef CONFIG_SND_OSSEMUL
-               if (snd_oss_root)
-                       snd_info_unregister(snd_oss_root);
+               snd_info_unregister(snd_oss_root);
 #endif
                snd_remove_proc_entry(&proc_root, snd_proc_root);
        }
@@ -937,7 +924,8 @@ int snd_info_unregister(struct snd_info_entry * entry)
 {
        struct proc_dir_entry *root;
 
-       snd_assert(entry != NULL, return -ENXIO);
+       if (! entry)
+               return 0;
        snd_assert(entry->p != NULL, return -ENXIO);
        root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
        snd_assert(root, return -ENXIO);