[ALSA] Clean up EXPORT_SYMBOL()s in snd module
[platform/adaptation/renesas_rcar/renesas_kernel.git] / sound / core / init.c
index 7581668..b145d17 100644 (file)
@@ -40,10 +40,13 @@ struct snd_shutdown_f_ops {
 
 unsigned int snd_cards_lock = 0;       /* locked for registering/using */
 struct snd_card *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL};
+EXPORT_SYMBOL(snd_cards);
+
 DEFINE_RWLOCK(snd_card_rwlock);
 
 #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
 int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int free_flag);
+EXPORT_SYMBOL(snd_mixer_oss_notify_callback);
 #endif
 
 #ifdef CONFIG_PROC_FS
@@ -145,7 +148,7 @@ struct snd_card *snd_card_new(int idx, const char *xid,
        init_waitqueue_head(&card->shutdown_sleep);
        INIT_WORK(&card->free_workq, snd_card_free_thread, card);
 #ifdef CONFIG_PM
-       init_MUTEX(&card->power_lock);
+       mutex_init(&card->power_lock);
        init_waitqueue_head(&card->power_sleep);
 #endif
        /* the control interface cannot be accessed from the user space until */
@@ -169,11 +172,46 @@ struct snd_card *snd_card_new(int idx, const char *xid,
        return NULL;
 }
 
+EXPORT_SYMBOL(snd_card_new);
+
+static loff_t snd_disconnect_llseek(struct file *file, loff_t offset, int orig)
+{
+       return -ENODEV;
+}
+
+static ssize_t snd_disconnect_read(struct file *file, char __user *buf,
+                                  size_t count, loff_t *offset)
+{
+       return -ENODEV;
+}
+
+static ssize_t snd_disconnect_write(struct file *file, const char __user *buf,
+                                   size_t count, loff_t *offset)
+{
+       return -ENODEV;
+}
+
 static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait)
 {
        return POLLERR | POLLNVAL;
 }
 
+static long snd_disconnect_ioctl(struct file *file,
+                                unsigned int cmd, unsigned long arg)
+{
+       return -ENODEV;
+}
+
+static int snd_disconnect_mmap(struct file *file, struct vm_area_struct *vma)
+{
+       return -ENODEV;
+}
+
+static int snd_disconnect_fasync(int fd, struct file *file, int on)
+{
+       return -ENODEV;
+}
+
 /**
  *  snd_card_disconnect - disconnect all APIs from the file-operations (user space)
  *  @card: soundcard structure
@@ -190,7 +228,8 @@ int snd_card_disconnect(struct snd_card *card)
        struct snd_monitor_file *mfile;
        struct file *file;
        struct snd_shutdown_f_ops *s_f_ops;
-       struct file_operations *f_ops, *old_f_ops;
+       struct file_operations *f_ops;
+       const struct file_operations *old_f_ops;
        int err;
 
        spin_lock(&card->files_lock);
@@ -224,7 +263,16 @@ int snd_card_disconnect(struct snd_card *card)
                memset(f_ops, 0, sizeof(*f_ops));
                f_ops->owner = file->f_op->owner;
                f_ops->release = file->f_op->release;
+               f_ops->llseek = snd_disconnect_llseek;
+               f_ops->read = snd_disconnect_read;
+               f_ops->write = snd_disconnect_write;
                f_ops->poll = snd_disconnect_poll;
+               f_ops->unlocked_ioctl = snd_disconnect_ioctl;
+#ifdef CONFIG_COMPAT
+               f_ops->compat_ioctl = snd_disconnect_ioctl;
+#endif
+               f_ops->mmap = snd_disconnect_mmap;
+               f_ops->fasync = snd_disconnect_fasync;
 
                s_f_ops->next = card->s_f_ops;
                card->s_f_ops = s_f_ops;
@@ -255,6 +303,8 @@ int snd_card_disconnect(struct snd_card *card)
        return 0;       
 }
 
+EXPORT_SYMBOL(snd_card_disconnect);
+
 /**
  *  snd_card_free - frees given soundcard structure
  *  @card: soundcard structure
@@ -317,6 +367,8 @@ int snd_card_free(struct snd_card *card)
        return 0;
 }
 
+EXPORT_SYMBOL(snd_card_free);
+
 static void snd_card_free_thread(void * __card)
 {
        struct snd_card *card = __card;
@@ -362,6 +414,8 @@ int snd_card_free_in_thread(struct snd_card *card)
        return -EFAULT;
 }
 
+EXPORT_SYMBOL(snd_card_free_in_thread);
+
 static void choose_default_id(struct snd_card *card)
 {
        int i, len, idx_flag = 0, loops = SNDRV_CARDS;
@@ -462,6 +516,8 @@ int snd_card_register(struct snd_card *card)
        return 0;
 }
 
+EXPORT_SYMBOL(snd_card_register);
+
 #ifdef CONFIG_PROC_FS
 static struct snd_info_entry *snd_card_info_entry = NULL;
 
@@ -601,6 +657,8 @@ int snd_component_add(struct snd_card *card, const char *component)
        return 0;
 }
 
+EXPORT_SYMBOL(snd_component_add);
+
 /**
  *  snd_card_file_add - add the file to the file list of the card
  *  @card: soundcard structure
@@ -633,6 +691,8 @@ int snd_card_file_add(struct snd_card *card, struct file *file)
        return 0;
 }
 
+EXPORT_SYMBOL(snd_card_file_add);
+
 /**
  *  snd_card_file_remove - remove the file from the file list
  *  @card: soundcard structure
@@ -674,18 +734,19 @@ int snd_card_file_remove(struct snd_card *card, struct file *file)
        return 0;
 }
 
+EXPORT_SYMBOL(snd_card_file_remove);
+
 #ifdef CONFIG_PM
 /**
  *  snd_power_wait - wait until the power-state is changed.
  *  @card: soundcard structure
  *  @power_state: expected power state
- *  @file: file structure for the O_NONBLOCK check (optional)
  *
  *  Waits until the power-state is changed.
  *
  *  Note: the power lock must be active before call.
  */
-int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file)
+int snd_power_wait(struct snd_card *card, unsigned int power_state)
 {
        wait_queue_t wait;
        int result = 0;
@@ -702,12 +763,6 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file
                }
                if (snd_power_get_state(card) == power_state)
                        break;
-#if 0 /* block all devices */
-               if (file && (file->f_flags & O_NONBLOCK)) {
-                       result = -EAGAIN;
-                       break;
-               }
-#endif
                set_current_state(TASK_UNINTERRUPTIBLE);
                snd_power_unlock(card);
                schedule_timeout(30 * HZ);
@@ -717,4 +772,5 @@ int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file
        return result;
 }
 
+EXPORT_SYMBOL(snd_power_wait);
 #endif /* CONFIG_PM */