Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219453
b: refs/heads/master
c: 4ae1839
h: refs/heads/master
i:
  219451: 9390c23
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 60476f9 commit effabe7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06f08e3a4d86e746f5e8e09030e6560e37386b7f
refs/heads/master: 4ae18398008d9a7fdddc6beb2e0b85fcc9cf093d
13 changes: 4 additions & 9 deletions trunk/drivers/staging/tm6000/tm6000-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,6 @@ void tm6000_add_into_devlist(struct tm6000_core *dev)
*/

static LIST_HEAD(tm6000_extension_devlist);
static DEFINE_MUTEX(tm6000_extension_devlist_lock);

int tm6000_call_fillbuf(struct tm6000_core *dev, enum tm6000_ops_type type,
char *buf, int size)
Expand All @@ -668,14 +667,12 @@ int tm6000_register_extension(struct tm6000_ops *ops)
struct tm6000_core *dev = NULL;

mutex_lock(&tm6000_devlist_mutex);
mutex_lock(&tm6000_extension_devlist_lock);
list_add_tail(&ops->next, &tm6000_extension_devlist);
list_for_each_entry(dev, &tm6000_devlist, devlist) {
ops->init(dev);
printk(KERN_INFO "%s: Initialized (%s) extension\n",
dev->name, ops->name);
}
mutex_unlock(&tm6000_extension_devlist_lock);
mutex_unlock(&tm6000_devlist_mutex);
return 0;
}
Expand All @@ -691,10 +688,8 @@ void tm6000_unregister_extension(struct tm6000_ops *ops)
ops->fini(dev);
}

mutex_lock(&tm6000_extension_devlist_lock);
printk(KERN_INFO "tm6000: Remove (%s) extension\n", ops->name);
list_del(&ops->next);
mutex_unlock(&tm6000_extension_devlist_lock);
mutex_unlock(&tm6000_devlist_mutex);
}
EXPORT_SYMBOL(tm6000_unregister_extension);
Expand All @@ -703,26 +698,26 @@ void tm6000_init_extension(struct tm6000_core *dev)
{
struct tm6000_ops *ops = NULL;

mutex_lock(&tm6000_extension_devlist_lock);
mutex_lock(&tm6000_devlist_mutex);
if (!list_empty(&tm6000_extension_devlist)) {
list_for_each_entry(ops, &tm6000_extension_devlist, next) {
if (ops->init)
ops->init(dev);
}
}
mutex_unlock(&tm6000_extension_devlist_lock);
mutex_unlock(&tm6000_devlist_mutex);
}

void tm6000_close_extension(struct tm6000_core *dev)
{
struct tm6000_ops *ops = NULL;

mutex_lock(&tm6000_extension_devlist_lock);
mutex_lock(&tm6000_devlist_mutex);
if (!list_empty(&tm6000_extension_devlist)) {
list_for_each_entry(ops, &tm6000_extension_devlist, next) {
if (ops->fini)
ops->fini(dev);
}
}
mutex_unlock(&tm6000_extension_devlist_lock);
mutex_lock(&tm6000_devlist_mutex);
}

0 comments on commit effabe7

Please sign in to comment.