aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-09-14 01:31:59 -0400
committerDmitry Torokhov <dtor@insightbb.com>2006-09-14 01:31:59 -0400
commit66e66118837ed95a299328437c2d9fb4b5137352 (patch)
tree901c8b3ab9ab01b0363992b65689cafe797fcb25 /drivers
parent5206c0d5ec514733dd098cf658d71327d199c7a0 (diff)
Input: constify input core
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/keyboard.c4
-rw-r--r--drivers/input/evbug.c8
-rw-r--r--drivers/input/evdev.c7
-rw-r--r--drivers/input/input.c7
-rw-r--r--drivers/input/joydev.c9
-rw-r--r--drivers/input/mousedev.c7
-rw-r--r--drivers/input/power.c4
-rw-r--r--drivers/input/tsdev.c8
8 files changed, 29 insertions, 25 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 30a745428a09..797480768b4e 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -1285,7 +1285,7 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
1285 */ 1285 */
1286static struct input_handle *kbd_connect(struct input_handler *handler, 1286static struct input_handle *kbd_connect(struct input_handler *handler,
1287 struct input_dev *dev, 1287 struct input_dev *dev,
1288 struct input_device_id *id) 1288 const struct input_device_id *id)
1289{ 1289{
1290 struct input_handle *handle; 1290 struct input_handle *handle;
1291 int i; 1291 int i;
@@ -1334,7 +1334,7 @@ static void kbd_start(struct input_handle *handle)
1334 tasklet_enable(&keyboard_tasklet); 1334 tasklet_enable(&keyboard_tasklet);
1335} 1335}
1336 1336
1337static struct input_device_id kbd_ids[] = { 1337static const struct input_device_id kbd_ids[] = {
1338 { 1338 {
1339 .flags = INPUT_DEVICE_ID_MATCH_EVBIT, 1339 .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
1340 .evbit = { BIT(EV_KEY) }, 1340 .evbit = { BIT(EV_KEY) },
diff --git a/drivers/input/evbug.c b/drivers/input/evbug.c
index 07358fb51b82..1d8ce7a1ec30 100644
--- a/drivers/input/evbug.c
+++ b/drivers/input/evbug.c
@@ -42,10 +42,12 @@ static char evbug_name[] = "evbug";
42 42
43static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) 43static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
44{ 44{
45 printk(KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n", handle->dev->phys, type, code, value); 45 printk(KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n",
46 handle->dev->phys, type, code, value);
46} 47}
47 48
48static struct input_handle *evbug_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) 49static struct input_handle *evbug_connect(struct input_handler *handler, struct input_dev *dev,
50 const struct input_device_id *id)
49{ 51{
50 struct input_handle *handle; 52 struct input_handle *handle;
51 53
@@ -72,7 +74,7 @@ static void evbug_disconnect(struct input_handle *handle)
72 kfree(handle); 74 kfree(handle);
73} 75}
74 76
75static struct input_device_id evbug_ids[] = { 77static const struct input_device_id evbug_ids[] = {
76 { .driver_info = 1 }, /* Matches all devices */ 78 { .driver_info = 1 }, /* Matches all devices */
77 { }, /* Terminating zero entry */ 79 { }, /* Terminating zero entry */
78}; 80};
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 12c7ab876c34..154e423167b9 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -601,7 +601,7 @@ static long evdev_ioctl_compat(struct file *file, unsigned int cmd, unsigned lon
601} 601}
602#endif 602#endif
603 603
604static struct file_operations evdev_fops = { 604static const struct file_operations evdev_fops = {
605 .owner = THIS_MODULE, 605 .owner = THIS_MODULE,
606 .read = evdev_read, 606 .read = evdev_read,
607 .write = evdev_write, 607 .write = evdev_write,
@@ -616,7 +616,8 @@ static struct file_operations evdev_fops = {
616 .flush = evdev_flush 616 .flush = evdev_flush
617}; 617};
618 618
619static struct input_handle *evdev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) 619static struct input_handle *evdev_connect(struct input_handler *handler, struct input_dev *dev,
620 const struct input_device_id *id)
620{ 621{
621 struct evdev *evdev; 622 struct evdev *evdev;
622 struct class_device *cdev; 623 struct class_device *cdev;
@@ -675,7 +676,7 @@ static void evdev_disconnect(struct input_handle *handle)
675 evdev_free(evdev); 676 evdev_free(evdev);
676} 677}
677 678
678static struct input_device_id evdev_ids[] = { 679static const struct input_device_id evdev_ids[] = {
679 { .driver_info = 1 }, /* Matches all devices */ 680 { .driver_info = 1 }, /* Matches all devices */
680 { }, /* Terminating zero entry */ 681 { }, /* Terminating zero entry */
681}; 682};
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 1c71dd6fe5cd..4954c790ccb1 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -313,7 +313,8 @@ static void input_link_handle(struct input_handle *handle)
313 if (i != NBITS(max)) \ 313 if (i != NBITS(max)) \
314 continue; 314 continue;
315 315
316static struct input_device_id *input_match_device(struct input_device_id *id, struct input_dev *dev) 316static const struct input_device_id *input_match_device(const struct input_device_id *id,
317 struct input_dev *dev)
317{ 318{
318 int i; 319 int i;
319 320
@@ -935,7 +936,7 @@ int input_register_device(struct input_dev *dev)
935 static atomic_t input_no = ATOMIC_INIT(0); 936 static atomic_t input_no = ATOMIC_INIT(0);
936 struct input_handle *handle; 937 struct input_handle *handle;
937 struct input_handler *handler; 938 struct input_handler *handler;
938 struct input_device_id *id; 939 const struct input_device_id *id;
939 const char *path; 940 const char *path;
940 int error; 941 int error;
941 942
@@ -1050,7 +1051,7 @@ void input_register_handler(struct input_handler *handler)
1050{ 1051{
1051 struct input_dev *dev; 1052 struct input_dev *dev;
1052 struct input_handle *handle; 1053 struct input_handle *handle;
1053 struct input_device_id *id; 1054 const struct input_device_id *id;
1054 1055
1055 if (!handler) 1056 if (!handler)
1056 return; 1057 return;
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index d67157513bf7..033e3aac92a3 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -451,7 +451,7 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
451 } 451 }
452} 452}
453 453
454static struct file_operations joydev_fops = { 454static const struct file_operations joydev_fops = {
455 .owner = THIS_MODULE, 455 .owner = THIS_MODULE,
456 .read = joydev_read, 456 .read = joydev_read,
457 .write = joydev_write, 457 .write = joydev_write,
@@ -465,7 +465,8 @@ static struct file_operations joydev_fops = {
465 .fasync = joydev_fasync, 465 .fasync = joydev_fasync,
466}; 466};
467 467
468static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) 468static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev,
469 const struct input_device_id *id)
469{ 470{
470 struct joydev *joydev; 471 struct joydev *joydev;
471 struct class_device *cdev; 472 struct class_device *cdev;
@@ -562,7 +563,7 @@ static void joydev_disconnect(struct input_handle *handle)
562 joydev_free(joydev); 563 joydev_free(joydev);
563} 564}
564 565
565static struct input_device_id joydev_blacklist[] = { 566static const struct input_device_id joydev_blacklist[] = {
566 { 567 {
567 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT, 568 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
568 .evbit = { BIT(EV_KEY) }, 569 .evbit = { BIT(EV_KEY) },
@@ -571,7 +572,7 @@ static struct input_device_id joydev_blacklist[] = {
571 { } /* Terminating entry */ 572 { } /* Terminating entry */
572}; 573};
573 574
574static struct input_device_id joydev_ids[] = { 575static const struct input_device_id joydev_ids[] = {
575 { 576 {
576 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, 577 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT,
577 .evbit = { BIT(EV_ABS) }, 578 .evbit = { BIT(EV_ABS) },
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 1f851acab30d..cd02f1b62b66 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -614,7 +614,7 @@ static unsigned int mousedev_poll(struct file *file, poll_table *wait)
614 (list->mousedev->exist ? 0 : (POLLHUP | POLLERR)); 614 (list->mousedev->exist ? 0 : (POLLHUP | POLLERR));
615} 615}
616 616
617static struct file_operations mousedev_fops = { 617static const struct file_operations mousedev_fops = {
618 .owner = THIS_MODULE, 618 .owner = THIS_MODULE,
619 .read = mousedev_read, 619 .read = mousedev_read,
620 .write = mousedev_write, 620 .write = mousedev_write,
@@ -624,7 +624,8 @@ static struct file_operations mousedev_fops = {
624 .fasync = mousedev_fasync, 624 .fasync = mousedev_fasync,
625}; 625};
626 626
627static struct input_handle *mousedev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) 627static struct input_handle *mousedev_connect(struct input_handler *handler, struct input_dev *dev,
628 const struct input_device_id *id)
628{ 629{
629 struct mousedev *mousedev; 630 struct mousedev *mousedev;
630 struct class_device *cdev; 631 struct class_device *cdev;
@@ -688,7 +689,7 @@ static void mousedev_disconnect(struct input_handle *handle)
688 } 689 }
689} 690}
690 691
691static struct input_device_id mousedev_ids[] = { 692static const struct input_device_id mousedev_ids[] = {
692 { 693 {
693 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_RELBIT, 694 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_RELBIT,
694 .evbit = { BIT(EV_KEY) | BIT(EV_REL) }, 695 .evbit = { BIT(EV_KEY) | BIT(EV_REL) },
diff --git a/drivers/input/power.c b/drivers/input/power.c
index 51a519e24b6d..75d018759cd5 100644
--- a/drivers/input/power.c
+++ b/drivers/input/power.c
@@ -98,7 +98,7 @@ static void power_event(struct input_handle *handle, unsigned int type,
98 98
99static struct input_handle *power_connect(struct input_handler *handler, 99static struct input_handle *power_connect(struct input_handler *handler,
100 struct input_dev *dev, 100 struct input_dev *dev,
101 struct input_device_id *id) 101 const struct input_device_id *id)
102{ 102{
103 struct input_handle *handle; 103 struct input_handle *handle;
104 104
@@ -120,7 +120,7 @@ static void power_disconnect(struct input_handle *handle)
120 kfree(handle); 120 kfree(handle);
121} 121}
122 122
123static struct input_device_id power_ids[] = { 123static const struct input_device_id power_ids[] = {
124 { 124 {
125 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT, 125 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
126 .evbit = { BIT(EV_KEY) }, 126 .evbit = { BIT(EV_KEY) },
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c
index 00e3929c6288..162ee08223a9 100644
--- a/drivers/input/tsdev.c
+++ b/drivers/input/tsdev.c
@@ -135,8 +135,6 @@ struct tsdev_list {
135#define TS_GET_CAL _IOR(IOC_H3600_TS_MAGIC, 10, struct ts_calibration) 135#define TS_GET_CAL _IOR(IOC_H3600_TS_MAGIC, 10, struct ts_calibration)
136#define TS_SET_CAL _IOW(IOC_H3600_TS_MAGIC, 11, struct ts_calibration) 136#define TS_SET_CAL _IOW(IOC_H3600_TS_MAGIC, 11, struct ts_calibration)
137 137
138static struct input_handler tsdev_handler;
139
140static struct tsdev *tsdev_table[TSDEV_MINORS/2]; 138static struct tsdev *tsdev_table[TSDEV_MINORS/2];
141 139
142static int tsdev_fasync(int fd, struct file *file, int on) 140static int tsdev_fasync(int fd, struct file *file, int on)
@@ -263,7 +261,7 @@ static int tsdev_ioctl(struct inode *inode, struct file *file,
263 return retval; 261 return retval;
264} 262}
265 263
266static struct file_operations tsdev_fops = { 264static const struct file_operations tsdev_fops = {
267 .owner = THIS_MODULE, 265 .owner = THIS_MODULE,
268 .open = tsdev_open, 266 .open = tsdev_open,
269 .release = tsdev_release, 267 .release = tsdev_release,
@@ -370,7 +368,7 @@ static void tsdev_event(struct input_handle *handle, unsigned int type,
370 368
371static struct input_handle *tsdev_connect(struct input_handler *handler, 369static struct input_handle *tsdev_connect(struct input_handler *handler,
372 struct input_dev *dev, 370 struct input_dev *dev,
373 struct input_device_id *id) 371 const struct input_device_id *id)
374{ 372{
375 struct tsdev *tsdev; 373 struct tsdev *tsdev;
376 struct class_device *cdev; 374 struct class_device *cdev;
@@ -443,7 +441,7 @@ static void tsdev_disconnect(struct input_handle *handle)
443 tsdev_free(tsdev); 441 tsdev_free(tsdev);
444} 442}
445 443
446static struct input_device_id tsdev_ids[] = { 444static const struct input_device_id tsdev_ids[] = {
447 { 445 {
448 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_RELBIT, 446 .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_RELBIT,
449 .evbit = { BIT(EV_KEY) | BIT(EV_REL) }, 447 .evbit = { BIT(EV_KEY) | BIT(EV_REL) },