aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index d3cdb139e962..7570a3f52f18 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -64,11 +64,13 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
64 case EV_SYN: 64 case EV_SYN:
65 switch (code) { 65 switch (code) {
66 case SYN_CONFIG: 66 case SYN_CONFIG:
67 if (dev->event) dev->event(dev, type, code, value); 67 if (dev->event)
68 dev->event(dev, type, code, value);
68 break; 69 break;
69 70
70 case SYN_REPORT: 71 case SYN_REPORT:
71 if (dev->sync) return; 72 if (dev->sync)
73 return;
72 dev->sync = 1; 74 dev->sync = 1;
73 break; 75 break;
74 } 76 }
@@ -137,7 +139,8 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
137 if (code > MSC_MAX || !test_bit(code, dev->mscbit)) 139 if (code > MSC_MAX || !test_bit(code, dev->mscbit))
138 return; 140 return;
139 141
140 if (dev->event) dev->event(dev, type, code, value); 142 if (dev->event)
143 dev->event(dev, type, code, value);
141 144
142 break; 145 break;
143 146
@@ -147,7 +150,9 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
147 return; 150 return;
148 151
149 change_bit(code, dev->led); 152 change_bit(code, dev->led);
150 if (dev->event) dev->event(dev, type, code, value); 153
154 if (dev->event)
155 dev->event(dev, type, code, value);
151 156
152 break; 157 break;
153 158
@@ -159,21 +164,25 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in
159 if (!!test_bit(code, dev->snd) != !!value) 164 if (!!test_bit(code, dev->snd) != !!value)
160 change_bit(code, dev->snd); 165 change_bit(code, dev->snd);
161 166
162 if (dev->event) dev->event(dev, type, code, value); 167 if (dev->event)
168 dev->event(dev, type, code, value);
163 169
164 break; 170 break;
165 171
166 case EV_REP: 172 case EV_REP:
167 173
168 if (code > REP_MAX || value < 0 || dev->rep[code] == value) return; 174 if (code > REP_MAX || value < 0 || dev->rep[code] == value)
175 return;
169 176
170 dev->rep[code] = value; 177 dev->rep[code] = value;
171 if (dev->event) dev->event(dev, type, code, value); 178 if (dev->event)
179 dev->event(dev, type, code, value);
172 180
173 break; 181 break;
174 182
175 case EV_FF: 183 case EV_FF:
176 if (dev->event) dev->event(dev, type, code, value); 184 if (dev->event)
185 dev->event(dev, type, code, value);
177 break; 186 break;
178 } 187 }
179 188
@@ -336,9 +345,11 @@ static inline void input_wakeup_procfs_readers(void)
336static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait) 345static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait)
337{ 346{
338 int state = input_devices_state; 347 int state = input_devices_state;
348
339 poll_wait(file, &input_devices_poll_wait, wait); 349 poll_wait(file, &input_devices_poll_wait, wait);
340 if (state != input_devices_state) 350 if (state != input_devices_state)
341 return POLLIN | POLLRDNORM; 351 return POLLIN | POLLRDNORM;
352
342 return 0; 353 return 0;
343} 354}
344 355
@@ -972,9 +983,10 @@ int input_register_device(struct input_dev *dev)
972 983
973void input_unregister_device(struct input_dev *dev) 984void input_unregister_device(struct input_dev *dev)
974{ 985{
975 struct list_head * node, * next; 986 struct list_head *node, *next;
976 987
977 if (!dev) return; 988 if (!dev)
989 return;
978 990
979 del_timer_sync(&dev->timer); 991 del_timer_sync(&dev->timer);
980 992
@@ -1005,7 +1017,8 @@ void input_register_handler(struct input_handler *handler)
1005 struct input_handle *handle; 1017 struct input_handle *handle;
1006 struct input_device_id *id; 1018 struct input_device_id *id;
1007 1019
1008 if (!handler) return; 1020 if (!handler)
1021 return;
1009 1022
1010 INIT_LIST_HEAD(&handler->h_list); 1023 INIT_LIST_HEAD(&handler->h_list);
1011 1024
@@ -1025,7 +1038,7 @@ void input_register_handler(struct input_handler *handler)
1025 1038
1026void input_unregister_handler(struct input_handler *handler) 1039void input_unregister_handler(struct input_handler *handler)
1027{ 1040{
1028 struct list_head * node, * next; 1041 struct list_head *node, *next;
1029 1042
1030 list_for_each_safe(node, next, &handler->h_list) { 1043 list_for_each_safe(node, next, &handler->h_list) {
1031 struct input_handle * handle = to_handle_h(node); 1044 struct input_handle * handle = to_handle_h(node);