• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/sound/core/seq/

Lines Matching refs:ops

66 	struct snd_seq_dev_ops ops;
93 static int init_device(struct snd_seq_device *dev, struct ops_list *ops);
94 static int free_device(struct snd_seq_device *dev, struct ops_list *ops);
97 static void unlock_driver(struct ops_list *ops);
108 struct ops_list *ops;
111 list_for_each_entry(ops, &opslist, list) {
113 ops->id,
114 ops->driver & DRIVER_LOADED ? ",loaded" : (ops->driver == DRIVER_EMPTY ? ",empty" : ""),
115 ops->driver & DRIVER_REQUESTED ? ",requested" : "",
116 ops->driver & DRIVER_LOCKED ? ",locked" : "",
117 ops->num_devices);
144 struct ops_list *ops;
153 list_for_each_entry(ops, &opslist, list) {
154 if (! (ops->driver & DRIVER_LOADED) &&
155 ! (ops->driver & DRIVER_REQUESTED)) {
156 ops->used++;
158 ops->driver |= DRIVER_REQUESTED;
159 request_module("snd-%s", ops->id);
161 ops->used--;
179 struct ops_list *ops;
193 ops = find_driver(id, 1);
194 if (ops == NULL)
199 unlock_driver(ops);
211 mutex_lock(&ops->reg_mutex);
212 list_add_tail(&dev->list, &ops->dev_list);
213 ops->num_devices++;
214 mutex_unlock(&ops->reg_mutex);
216 unlock_driver(ops);
234 struct ops_list *ops;
239 ops = find_driver(dev->id, 0);
240 if (ops == NULL)
244 mutex_lock(&ops->reg_mutex);
246 ops->num_devices--;
247 mutex_unlock(&ops->reg_mutex);
249 free_device(dev, ops);
254 unlock_driver(ops);
271 struct ops_list *ops;
273 ops = find_driver(dev->id, 0);
274 if (ops == NULL)
280 if (ops->driver & DRIVER_LOADED)
281 init_device(dev, ops);
283 unlock_driver(ops);
293 struct ops_list *ops;
295 ops = find_driver(dev->id, 0);
296 if (ops == NULL)
299 free_device(dev, ops);
301 unlock_driver(ops);
313 struct ops_list *ops;
321 ops = find_driver(id, 1);
322 if (ops == NULL) {
326 if (ops->driver & DRIVER_LOADED) {
328 unlock_driver(ops);
333 mutex_lock(&ops->reg_mutex);
335 ops->ops = *entry;
336 ops->driver |= DRIVER_LOADED;
337 ops->argsize = argsize;
340 list_for_each_entry(dev, &ops->dev_list, list) {
341 init_device(dev, ops);
343 mutex_unlock(&ops->reg_mutex);
345 unlock_driver(ops);
357 struct ops_list *ops;
359 ops = kzalloc(sizeof(*ops), GFP_KERNEL);
360 if (ops == NULL)
361 return ops;
364 strlcpy(ops->id, id, sizeof(ops->id));
365 mutex_init(&ops->reg_mutex);
370 lockdep_set_class(&ops->reg_mutex, (struct lock_class_key *)id);
372 ops->driver = DRIVER_EMPTY;
373 INIT_LIST_HEAD(&ops->dev_list);
375 ops->used = 1;
379 list_add_tail(&ops->list, &opslist);
383 return ops;
392 struct ops_list *ops;
395 ops = find_driver(id, 0);
396 if (ops == NULL)
398 if (! (ops->driver & DRIVER_LOADED) ||
399 (ops->driver & DRIVER_LOCKED)) {
401 id, ops->driver);
402 unlock_driver(ops);
407 mutex_lock(&ops->reg_mutex);
408 ops->driver |= DRIVER_LOCKED; /* do not remove this driver recursively */
409 list_for_each_entry(dev, &ops->dev_list, list) {
410 free_device(dev, ops);
413 ops->driver = 0;
414 if (ops->num_init_devices > 0)
416 ops->num_init_devices);
417 mutex_unlock(&ops->reg_mutex);
419 unlock_driver(ops);
438 struct ops_list *ops = list_entry(head, struct ops_list, list);
439 if (! (ops->driver & DRIVER_LOADED) &&
440 ops->used == 0 && ops->num_devices == 0) {
442 list_del(&ops->list);
443 kfree(ops);
454 static int init_device(struct snd_seq_device *dev, struct ops_list *ops)
456 if (! (ops->driver & DRIVER_LOADED))
460 if (ops->argsize != dev->argsize) {
462 dev->name, ops->id, ops->argsize, dev->argsize);
465 if (ops->ops.init_device(dev) >= 0) {
467 ops->num_init_devices++;
479 static int free_device(struct snd_seq_device *dev, struct ops_list *ops)
483 if (! (ops->driver & DRIVER_LOADED))
487 if (ops->argsize != dev->argsize) {
489 dev->name, ops->id, ops->argsize, dev->argsize);
492 if ((result = ops->ops.free_device(dev)) >= 0 || result == -ENXIO) {
495 ops->num_init_devices--;
509 struct ops_list *ops;
512 list_for_each_entry(ops, &opslist, list) {
513 if (strcmp(ops->id, id) == 0) {
514 ops->used++;
516 return ops;
525 static void unlock_driver(struct ops_list *ops)
528 ops->used--;