aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm/ioctl.c')
-rw-r--r--net/atm/ioctl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c
index eb109af7eb4a..851cfa6312af 100644
--- a/net/atm/ioctl.c
+++ b/net/atm/ioctl.c
@@ -18,6 +18,7 @@
18#include <linux/atmmpc.h> 18#include <linux/atmmpc.h>
19#include <net/atmclip.h> 19#include <net/atmclip.h>
20#include <linux/atmlec.h> 20#include <linux/atmlec.h>
21#include <linux/mutex.h>
21#include <asm/ioctls.h> 22#include <asm/ioctls.h>
22 23
23#include "resources.h" 24#include "resources.h"
@@ -25,22 +26,22 @@
25#include "common.h" 26#include "common.h"
26 27
27 28
28static DECLARE_MUTEX(ioctl_mutex); 29static DEFINE_MUTEX(ioctl_mutex);
29static LIST_HEAD(ioctl_list); 30static LIST_HEAD(ioctl_list);
30 31
31 32
32void register_atm_ioctl(struct atm_ioctl *ioctl) 33void register_atm_ioctl(struct atm_ioctl *ioctl)
33{ 34{
34 down(&ioctl_mutex); 35 mutex_lock(&ioctl_mutex);
35 list_add_tail(&ioctl->list, &ioctl_list); 36 list_add_tail(&ioctl->list, &ioctl_list);
36 up(&ioctl_mutex); 37 mutex_unlock(&ioctl_mutex);
37} 38}
38 39
39void deregister_atm_ioctl(struct atm_ioctl *ioctl) 40void deregister_atm_ioctl(struct atm_ioctl *ioctl)
40{ 41{
41 down(&ioctl_mutex); 42 mutex_lock(&ioctl_mutex);
42 list_del(&ioctl->list); 43 list_del(&ioctl->list);
43 up(&ioctl_mutex); 44 mutex_unlock(&ioctl_mutex);
44} 45}
45 46
46EXPORT_SYMBOL(register_atm_ioctl); 47EXPORT_SYMBOL(register_atm_ioctl);
@@ -137,7 +138,7 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
137 138
138 error = -ENOIOCTLCMD; 139 error = -ENOIOCTLCMD;
139 140
140 down(&ioctl_mutex); 141 mutex_lock(&ioctl_mutex);
141 list_for_each(pos, &ioctl_list) { 142 list_for_each(pos, &ioctl_list) {
142 struct atm_ioctl * ic = list_entry(pos, struct atm_ioctl, list); 143 struct atm_ioctl * ic = list_entry(pos, struct atm_ioctl, list);
143 if (try_module_get(ic->owner)) { 144 if (try_module_get(ic->owner)) {
@@ -147,7 +148,7 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
147 break; 148 break;
148 } 149 }
149 } 150 }
150 up(&ioctl_mutex); 151 mutex_unlock(&ioctl_mutex);
151 152
152 if (error != -ENOIOCTLCMD) 153 if (error != -ENOIOCTLCMD)
153 goto done; 154 goto done;