aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-16 02:27:36 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-16 02:52:33 -0400
commit20da92de8ec3c1d4ba7e5aca322d38b6ce634932 (patch)
tree2349309cc452763e649c75f94bf00c327376f8d2
parent72c8a94a585afea1f45aa8c4f6938ed6d05be57a (diff)
Input: change input handlers to use bool when possible
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/evdev.c6
-rw-r--r--drivers/input/input.c6
-rw-r--r--drivers/input/joydev.c7
-rw-r--r--drivers/input/mousedev.c6
-rw-r--r--include/linux/input.h6
5 files changed, 15 insertions, 16 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index fc5afbd78625..70c0eb52ca96 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -24,7 +24,6 @@
24#include "input-compat.h" 24#include "input-compat.h"
25 25
26struct evdev { 26struct evdev {
27 int exist;
28 int open; 27 int open;
29 int minor; 28 int minor;
30 struct input_handle handle; 29 struct input_handle handle;
@@ -34,6 +33,7 @@ struct evdev {
34 spinlock_t client_lock; /* protects client_list */ 33 spinlock_t client_lock; /* protects client_list */
35 struct mutex mutex; 34 struct mutex mutex;
36 struct device dev; 35 struct device dev;
36 bool exist;
37}; 37};
38 38
39struct evdev_client { 39struct evdev_client {
@@ -793,7 +793,7 @@ static void evdev_remove_chrdev(struct evdev *evdev)
793static void evdev_mark_dead(struct evdev *evdev) 793static void evdev_mark_dead(struct evdev *evdev)
794{ 794{
795 mutex_lock(&evdev->mutex); 795 mutex_lock(&evdev->mutex);
796 evdev->exist = 0; 796 evdev->exist = false;
797 mutex_unlock(&evdev->mutex); 797 mutex_unlock(&evdev->mutex);
798} 798}
799 799
@@ -842,7 +842,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,
842 init_waitqueue_head(&evdev->wait); 842 init_waitqueue_head(&evdev->wait);
843 843
844 dev_set_name(&evdev->dev, "event%d", minor); 844 dev_set_name(&evdev->dev, "event%d", minor);
845 evdev->exist = 1; 845 evdev->exist = true;
846 evdev->minor = minor; 846 evdev->minor = minor;
847 847
848 evdev->handle.dev = input_get_device(dev); 848 evdev->handle.dev = input_get_device(dev);
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 54109c33e36c..e1243b4b32a5 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -227,12 +227,12 @@ static void input_handle_event(struct input_dev *dev,
227 227
228 case SYN_REPORT: 228 case SYN_REPORT:
229 if (!dev->sync) { 229 if (!dev->sync) {
230 dev->sync = 1; 230 dev->sync = true;
231 disposition = INPUT_PASS_TO_HANDLERS; 231 disposition = INPUT_PASS_TO_HANDLERS;
232 } 232 }
233 break; 233 break;
234 case SYN_MT_REPORT: 234 case SYN_MT_REPORT:
235 dev->sync = 0; 235 dev->sync = false;
236 disposition = INPUT_PASS_TO_HANDLERS; 236 disposition = INPUT_PASS_TO_HANDLERS;
237 break; 237 break;
238 } 238 }
@@ -317,7 +317,7 @@ static void input_handle_event(struct input_dev *dev,
317 } 317 }
318 318
319 if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN) 319 if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN)
320 dev->sync = 0; 320 dev->sync = false;
321 321
322 if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event) 322 if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event)
323 dev->event(dev, type, code, value); 323 dev->event(dev, type, code, value);
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 34157bb97ed6..63834585c283 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -37,7 +37,6 @@ MODULE_LICENSE("GPL");
37#define JOYDEV_BUFFER_SIZE 64 37#define JOYDEV_BUFFER_SIZE 64
38 38
39struct joydev { 39struct joydev {
40 int exist;
41 int open; 40 int open;
42 int minor; 41 int minor;
43 struct input_handle handle; 42 struct input_handle handle;
@@ -46,6 +45,7 @@ struct joydev {
46 spinlock_t client_lock; /* protects client_list */ 45 spinlock_t client_lock; /* protects client_list */
47 struct mutex mutex; 46 struct mutex mutex;
48 struct device dev; 47 struct device dev;
48 bool exist;
49 49
50 struct js_corr corr[ABS_CNT]; 50 struct js_corr corr[ABS_CNT];
51 struct JS_DATA_SAVE_TYPE glue; 51 struct JS_DATA_SAVE_TYPE glue;
@@ -760,7 +760,7 @@ static void joydev_remove_chrdev(struct joydev *joydev)
760static void joydev_mark_dead(struct joydev *joydev) 760static void joydev_mark_dead(struct joydev *joydev)
761{ 761{
762 mutex_lock(&joydev->mutex); 762 mutex_lock(&joydev->mutex);
763 joydev->exist = 0; 763 joydev->exist = false;
764 mutex_unlock(&joydev->mutex); 764 mutex_unlock(&joydev->mutex);
765} 765}
766 766
@@ -817,10 +817,9 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev,
817 init_waitqueue_head(&joydev->wait); 817 init_waitqueue_head(&joydev->wait);
818 818
819 dev_set_name(&joydev->dev, "js%d", minor); 819 dev_set_name(&joydev->dev, "js%d", minor);
820 joydev->exist = 1; 820 joydev->exist = true;
821 joydev->minor = minor; 821 joydev->minor = minor;
822 822
823 joydev->exist = 1;
824 joydev->handle.dev = input_get_device(dev); 823 joydev->handle.dev = input_get_device(dev);
825 joydev->handle.name = dev_name(&joydev->dev); 824 joydev->handle.name = dev_name(&joydev->dev);
826 joydev->handle.handler = handler; 825 joydev->handle.handler = handler;
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index f34b22bce4ff..d7a7a2fce745 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -57,7 +57,6 @@ struct mousedev_hw_data {
57}; 57};
58 58
59struct mousedev { 59struct mousedev {
60 int exist;
61 int open; 60 int open;
62 int minor; 61 int minor;
63 struct input_handle handle; 62 struct input_handle handle;
@@ -66,6 +65,7 @@ struct mousedev {
66 spinlock_t client_lock; /* protects client_list */ 65 spinlock_t client_lock; /* protects client_list */
67 struct mutex mutex; 66 struct mutex mutex;
68 struct device dev; 67 struct device dev;
68 bool exist;
69 69
70 struct list_head mixdev_node; 70 struct list_head mixdev_node;
71 int mixdev_open; 71 int mixdev_open;
@@ -802,7 +802,7 @@ static void mousedev_remove_chrdev(struct mousedev *mousedev)
802static void mousedev_mark_dead(struct mousedev *mousedev) 802static void mousedev_mark_dead(struct mousedev *mousedev)
803{ 803{
804 mutex_lock(&mousedev->mutex); 804 mutex_lock(&mousedev->mutex);
805 mousedev->exist = 0; 805 mousedev->exist = false;
806 mutex_unlock(&mousedev->mutex); 806 mutex_unlock(&mousedev->mutex);
807} 807}
808 808
@@ -862,7 +862,7 @@ static struct mousedev *mousedev_create(struct input_dev *dev,
862 dev_set_name(&mousedev->dev, "mouse%d", minor); 862 dev_set_name(&mousedev->dev, "mouse%d", minor);
863 863
864 mousedev->minor = minor; 864 mousedev->minor = minor;
865 mousedev->exist = 1; 865 mousedev->exist = true;
866 mousedev->handle.dev = input_get_device(dev); 866 mousedev->handle.dev = input_get_device(dev);
867 mousedev->handle.name = dev_name(&mousedev->dev); 867 mousedev->handle.name = dev_name(&mousedev->dev);
868 mousedev->handle.handler = handler; 868 mousedev->handle.handler = handler;
diff --git a/include/linux/input.h b/include/linux/input.h
index a14de64ed16a..339d043ccb53 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1099,7 +1099,6 @@ struct input_mt_slot {
1099 * @repeat_key: stores key code of the last key pressed; used to implement 1099 * @repeat_key: stores key code of the last key pressed; used to implement
1100 * software autorepeat 1100 * software autorepeat
1101 * @timer: timer for software autorepeat 1101 * @timer: timer for software autorepeat
1102 * @sync: set to 1 when there were no new events since last EV_SYNC
1103 * @abs: current values for reports from absolute axes 1102 * @abs: current values for reports from absolute axes
1104 * @rep: current values for autorepeat parameters (delay, rate) 1103 * @rep: current values for autorepeat parameters (delay, rate)
1105 * @mt: pointer to array of struct input_mt_slot holding current values 1104 * @mt: pointer to array of struct input_mt_slot holding current values
@@ -1144,6 +1143,7 @@ struct input_mt_slot {
1144 * last user closes the device 1143 * last user closes the device
1145 * @going_away: marks devices that are in a middle of unregistering and 1144 * @going_away: marks devices that are in a middle of unregistering and
1146 * causes input_open_device*() fail with -ENODEV. 1145 * causes input_open_device*() fail with -ENODEV.
1146 * @sync: set to %true when there were no new events since last EV_SYN
1147 * @dev: driver model's view of this device 1147 * @dev: driver model's view of this device
1148 * @h_list: list of input handles associated with the device. When 1148 * @h_list: list of input handles associated with the device. When
1149 * accessing the list dev->mutex must be held 1149 * accessing the list dev->mutex must be held
@@ -1180,8 +1180,6 @@ struct input_dev {
1180 unsigned int repeat_key; 1180 unsigned int repeat_key;
1181 struct timer_list timer; 1181 struct timer_list timer;
1182 1182
1183 int sync;
1184
1185 int abs[ABS_CNT]; 1183 int abs[ABS_CNT];
1186 int rep[REP_MAX + 1]; 1184 int rep[REP_MAX + 1];
1187 1185
@@ -1213,6 +1211,8 @@ struct input_dev {
1213 unsigned int users; 1211 unsigned int users;
1214 bool going_away; 1212 bool going_away;
1215 1213
1214 bool sync;
1215
1216 struct device dev; 1216 struct device dev;
1217 1217
1218 struct list_head h_list; 1218 struct list_head h_list;