diff options
Diffstat (limited to 'sound/core/init.c')
| -rw-r--r-- | sound/core/init.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/sound/core/init.c b/sound/core/init.c index 75816688607c..ad68761abba1 100644 --- a/sound/core/init.c +++ b/sound/core/init.c | |||
| @@ -145,7 +145,7 @@ struct snd_card *snd_card_new(int idx, const char *xid, | |||
| 145 | init_waitqueue_head(&card->shutdown_sleep); | 145 | init_waitqueue_head(&card->shutdown_sleep); |
| 146 | INIT_WORK(&card->free_workq, snd_card_free_thread, card); | 146 | INIT_WORK(&card->free_workq, snd_card_free_thread, card); |
| 147 | #ifdef CONFIG_PM | 147 | #ifdef CONFIG_PM |
| 148 | init_MUTEX(&card->power_lock); | 148 | mutex_init(&card->power_lock); |
| 149 | init_waitqueue_head(&card->power_sleep); | 149 | init_waitqueue_head(&card->power_sleep); |
| 150 | #endif | 150 | #endif |
| 151 | /* the control interface cannot be accessed from the user space until */ | 151 | /* the control interface cannot be accessed from the user space until */ |
| @@ -169,11 +169,44 @@ struct snd_card *snd_card_new(int idx, const char *xid, | |||
| 169 | return NULL; | 169 | return NULL; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | static loff_t snd_disconnect_llseek(struct file *file, loff_t offset, int orig) | ||
| 173 | { | ||
| 174 | return -ENODEV; | ||
| 175 | } | ||
| 176 | |||
| 177 | static ssize_t snd_disconnect_read(struct file *file, char __user *buf, | ||
| 178 | size_t count, loff_t *offset) | ||
| 179 | { | ||
| 180 | return -ENODEV; | ||
| 181 | } | ||
| 182 | |||
| 183 | static ssize_t snd_disconnect_write(struct file *file, const char __user *buf, | ||
| 184 | size_t count, loff_t *offset) | ||
| 185 | { | ||
| 186 | return -ENODEV; | ||
| 187 | } | ||
| 188 | |||
| 172 | static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait) | 189 | static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait) |
| 173 | { | 190 | { |
| 174 | return POLLERR | POLLNVAL; | 191 | return POLLERR | POLLNVAL; |
| 175 | } | 192 | } |
| 176 | 193 | ||
| 194 | static long snd_disconnect_ioctl(struct file *file, | ||
| 195 | unsigned int cmd, unsigned long arg) | ||
| 196 | { | ||
| 197 | return -ENODEV; | ||
| 198 | } | ||
| 199 | |||
| 200 | static int snd_disconnect_mmap(struct file *file, struct vm_area_struct *vma) | ||
| 201 | { | ||
| 202 | return -ENODEV; | ||
| 203 | } | ||
| 204 | |||
| 205 | static int snd_disconnect_fasync(int fd, struct file *file, int on) | ||
| 206 | { | ||
| 207 | return -ENODEV; | ||
| 208 | } | ||
| 209 | |||
| 177 | /** | 210 | /** |
| 178 | * snd_card_disconnect - disconnect all APIs from the file-operations (user space) | 211 | * snd_card_disconnect - disconnect all APIs from the file-operations (user space) |
| 179 | * @card: soundcard structure | 212 | * @card: soundcard structure |
| @@ -224,7 +257,16 @@ int snd_card_disconnect(struct snd_card *card) | |||
| 224 | memset(f_ops, 0, sizeof(*f_ops)); | 257 | memset(f_ops, 0, sizeof(*f_ops)); |
| 225 | f_ops->owner = file->f_op->owner; | 258 | f_ops->owner = file->f_op->owner; |
| 226 | f_ops->release = file->f_op->release; | 259 | f_ops->release = file->f_op->release; |
| 260 | f_ops->llseek = snd_disconnect_llseek; | ||
| 261 | f_ops->read = snd_disconnect_read; | ||
| 262 | f_ops->write = snd_disconnect_write; | ||
| 227 | f_ops->poll = snd_disconnect_poll; | 263 | f_ops->poll = snd_disconnect_poll; |
| 264 | f_ops->unlocked_ioctl = snd_disconnect_ioctl; | ||
| 265 | #ifdef CONFIG_COMPAT | ||
| 266 | f_ops->compat_ioctl = snd_disconnect_ioctl; | ||
| 267 | #endif | ||
| 268 | f_ops->mmap = snd_disconnect_mmap; | ||
| 269 | f_ops->fasync = snd_disconnect_fasync; | ||
| 228 | 270 | ||
| 229 | s_f_ops->next = card->s_f_ops; | 271 | s_f_ops->next = card->s_f_ops; |
| 230 | card->s_f_ops = s_f_ops; | 272 | card->s_f_ops = s_f_ops; |
