aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
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 /drivers/input
parent72c8a94a585afea1f45aa8c4f6938ed6d05be57a (diff)
Input: change input handlers to use bool when possible
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-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
4 files changed, 12 insertions, 13 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;