aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-04-12 01:34:20 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-04-12 01:34:20 -0400
commitb356872fa48a3f6b6f187444b0ea55e6e21c3575 (patch)
treeb07658d166da4c32fd9801eb8d102b081fbea140 /drivers/input/keyboard
parent8715c1cfadf8cce24e79d254f95bd4a84c7741f0 (diff)
Input: drivers/input/keyboard - don't access dev->private directly
Use input_get_drvdata() and input_set_drvdata() instead. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/aaed2000_kbd.c6
-rw-r--r--drivers/input/keyboard/atkbd.c5
-rw-r--r--drivers/input/keyboard/corgikbd.c1
-rw-r--r--drivers/input/keyboard/gpio_keys.c1
-rw-r--r--drivers/input/keyboard/hil_kbd.c2
-rw-r--r--drivers/input/keyboard/hilkbd.c1
-rw-r--r--drivers/input/keyboard/lkkbd.c5
-rw-r--r--drivers/input/keyboard/locomokbd.c1
-rw-r--r--drivers/input/keyboard/newtonkbd.c1
-rw-r--r--drivers/input/keyboard/omap-keypad.c1
-rw-r--r--drivers/input/keyboard/spitzkbd.c1
-rw-r--r--drivers/input/keyboard/stowaway.c1
-rw-r--r--drivers/input/keyboard/sunkbd.c6
-rw-r--r--drivers/input/keyboard/xtkbd.c1
14 files changed, 13 insertions, 20 deletions
diff --git a/drivers/input/keyboard/aaed2000_kbd.c b/drivers/input/keyboard/aaed2000_kbd.c
index 65fcb6af63a8..e584413f1d04 100644
--- a/drivers/input/keyboard/aaed2000_kbd.c
+++ b/drivers/input/keyboard/aaed2000_kbd.c
@@ -97,7 +97,7 @@ static void aaedkbd_work(void *data)
97 97
98static int aaedkbd_open(struct input_dev *indev) 98static int aaedkbd_open(struct input_dev *indev)
99{ 99{
100 struct aaedkbd *aaedkbd = indev->private; 100 struct aaedkbd *aaedkbd = input_get_drvdata(indev);
101 101
102 schedule_delayed_work(&aaedkbd->workq, msecs_to_jiffies(SCAN_INTERVAL)); 102 schedule_delayed_work(&aaedkbd->workq, msecs_to_jiffies(SCAN_INTERVAL));
103 103
@@ -106,7 +106,7 @@ static int aaedkbd_open(struct input_dev *indev)
106 106
107static void aaedkbd_close(struct input_dev *indev) 107static void aaedkbd_close(struct input_dev *indev)
108{ 108{
109 struct aaedkbd *aaedkbd = indev->private; 109 struct aaedkbd *aaedkbd = input_get_drvdata(indev);
110 110
111 cancel_delayed_work(&aaedkbd->workq); 111 cancel_delayed_work(&aaedkbd->workq);
112 flush_scheduled_work(); 112 flush_scheduled_work();
@@ -142,7 +142,7 @@ static int __devinit aaedkbd_probe(struct platform_device *pdev)
142 input_dev->id.product = 0x0001; 142 input_dev->id.product = 0x0001;
143 input_dev->id.version = 0x0100; 143 input_dev->id.version = 0x0100;
144 input_dev->cdev.dev = &pdev->dev; 144 input_dev->cdev.dev = &pdev->dev;
145 input_dev->private = aaedkbd; 145 input_set_drvdata(input_dev, aaedkbd);
146 146
147 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 147 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
148 input_dev->keycode = aaedkbd->keycode; 148 input_dev->keycode = aaedkbd->keycode;
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 663877076bc7..04754732c2c5 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -586,7 +586,7 @@ static void atkbd_event_work(struct work_struct *work)
586 586
587static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 587static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
588{ 588{
589 struct atkbd *atkbd = dev->private; 589 struct atkbd *atkbd = input_get_drvdata(dev);
590 590
591 if (!atkbd->write) 591 if (!atkbd->write)
592 return -1; 592 return -1;
@@ -883,9 +883,10 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd)
883 input_dev->id.product = atkbd->translated ? 1 : atkbd->set; 883 input_dev->id.product = atkbd->translated ? 1 : atkbd->set;
884 input_dev->id.version = atkbd->id; 884 input_dev->id.version = atkbd->id;
885 input_dev->event = atkbd_event; 885 input_dev->event = atkbd_event;
886 input_dev->private = atkbd;
887 input_dev->cdev.dev = &atkbd->ps2dev.serio->dev; 886 input_dev->cdev.dev = &atkbd->ps2dev.serio->dev;
888 887
888 input_set_drvdata(input_dev, atkbd);
889
889 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_MSC); 890 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_MSC);
890 891
891 if (atkbd->write) { 892 if (atkbd->write) {
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c
index 1016c94e65db..25dd87992171 100644
--- a/drivers/input/keyboard/corgikbd.c
+++ b/drivers/input/keyboard/corgikbd.c
@@ -324,7 +324,6 @@ static int __init corgikbd_probe(struct platform_device *pdev)
324 input_dev->id.product = 0x0001; 324 input_dev->id.product = 0x0001;
325 input_dev->id.version = 0x0100; 325 input_dev->id.version = 0x0100;
326 input_dev->cdev.dev = &pdev->dev; 326 input_dev->cdev.dev = &pdev->dev;
327 input_dev->private = corgikbd;
328 327
329 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); 328 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW);
330 input_dev->keycode = corgikbd->keycode; 329 input_dev->keycode = corgikbd->keycode;
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index fa03a00b4c6d..b94399359ee8 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -66,7 +66,6 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
66 input->name = pdev->name; 66 input->name = pdev->name;
67 input->phys = "gpio-keys/input0"; 67 input->phys = "gpio-keys/input0";
68 input->cdev.dev = &pdev->dev; 68 input->cdev.dev = &pdev->dev;
69 input->private = pdata;
70 69
71 input->id.bustype = BUS_HOST; 70 input->id.bustype = BUS_HOST;
72 input->id.vendor = 0x0001; 71 input->id.vendor = 0x0001;
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index 18f4d417576f..087d4df2c495 100644
--- a/drivers/input/keyboard/hil_kbd.c
+++ b/drivers/input/keyboard/hil_kbd.c
@@ -269,8 +269,6 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
269 if (!kbd->dev) 269 if (!kbd->dev)
270 goto bail0; 270 goto bail0;
271 271
272 kbd->dev->private = kbd;
273
274 if (serio_open(serio, drv)) 272 if (serio_open(serio, drv))
275 goto bail1; 273 goto bail1;
276 274
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c
index 230f5db30f0f..73b85cb59830 100644
--- a/drivers/input/keyboard/hilkbd.c
+++ b/drivers/input/keyboard/hilkbd.c
@@ -215,7 +215,6 @@ hil_keyb_init(void)
215 hil_dev.dev = input_allocate_device(); 215 hil_dev.dev = input_allocate_device();
216 if (!hil_dev.dev) 216 if (!hil_dev.dev)
217 return -ENOMEM; 217 return -ENOMEM;
218 hil_dev.dev->private = &hil_dev;
219 218
220#if defined(CONFIG_HP300) 219#if defined(CONFIG_HP300)
221 if (!hwreg_present((void *)(HILBASE + HIL_DATA))) { 220 if (!hwreg_present((void *)(HILBASE + HIL_DATA))) {
diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c
index 3d4d0a0ede28..257b9d42bba5 100644
--- a/drivers/input/keyboard/lkkbd.c
+++ b/drivers/input/keyboard/lkkbd.c
@@ -515,7 +515,7 @@ static int
515lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code, 515lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code,
516 int value) 516 int value)
517{ 517{
518 struct lkkbd *lk = dev->private; 518 struct lkkbd *lk = input_get_drvdata (dev);
519 unsigned char leds_on = 0; 519 unsigned char leds_on = 0;
520 unsigned char leds_off = 0; 520 unsigned char leds_off = 0;
521 521
@@ -668,7 +668,8 @@ lkkbd_connect (struct serio *serio, struct serio_driver *drv)
668 input_dev->id.version = 0x0100; 668 input_dev->id.version = 0x0100;
669 input_dev->cdev.dev = &serio->dev; 669 input_dev->cdev.dev = &serio->dev;
670 input_dev->event = lkkbd_event; 670 input_dev->event = lkkbd_event;
671 input_dev->private = lk; 671
672 input_set_drvdata (input_dev, lk);
672 673
673 set_bit (EV_KEY, input_dev->evbit); 674 set_bit (EV_KEY, input_dev->evbit);
674 set_bit (EV_LED, input_dev->evbit); 675 set_bit (EV_LED, input_dev->evbit);
diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c
index 2ade5186cc41..764f5ee764fa 100644
--- a/drivers/input/keyboard/locomokbd.c
+++ b/drivers/input/keyboard/locomokbd.c
@@ -231,7 +231,6 @@ static int locomokbd_probe(struct locomo_dev *dev)
231 input_dev->id.vendor = 0x0001; 231 input_dev->id.vendor = 0x0001;
232 input_dev->id.product = 0x0001; 232 input_dev->id.product = 0x0001;
233 input_dev->id.version = 0x0100; 233 input_dev->id.version = 0x0100;
234 input_dev->private = locomokbd;
235 234
236 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 235 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
237 input_dev->keycode = locomokbd->keycode; 236 input_dev->keycode = locomokbd->keycode;
diff --git a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c
index aa29b50765c9..179f3a4f4eda 100644
--- a/drivers/input/keyboard/newtonkbd.c
+++ b/drivers/input/keyboard/newtonkbd.c
@@ -105,7 +105,6 @@ static int nkbd_connect(struct serio *serio, struct serio_driver *drv)
105 input_dev->id.product = 0x0001; 105 input_dev->id.product = 0x0001;
106 input_dev->id.version = 0x0100; 106 input_dev->id.version = 0x0100;
107 input_dev->cdev.dev = &serio->dev; 107 input_dev->cdev.dev = &serio->dev;
108 input_dev->private = nkbd;
109 108
110 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 109 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
111 input_dev->keycode = nkbd->keycode; 110 input_dev->keycode = nkbd->keycode;
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 5680a6d95b2b..1790f0c15f11 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -371,7 +371,6 @@ static int __init omap_kp_probe(struct platform_device *pdev)
371 input_dev->name = "omap-keypad"; 371 input_dev->name = "omap-keypad";
372 input_dev->phys = "omap-keypad/input0"; 372 input_dev->phys = "omap-keypad/input0";
373 input_dev->cdev.dev = &pdev->dev; 373 input_dev->cdev.dev = &pdev->dev;
374 input_dev->private = omap_kp;
375 374
376 input_dev->id.bustype = BUS_HOST; 375 input_dev->id.bustype = BUS_HOST;
377 input_dev->id.vendor = 0x0001; 376 input_dev->id.vendor = 0x0001;
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c
index 8a2166c77ff4..bc960748bf00 100644
--- a/drivers/input/keyboard/spitzkbd.c
+++ b/drivers/input/keyboard/spitzkbd.c
@@ -372,7 +372,6 @@ static int __init spitzkbd_probe(struct platform_device *dev)
372 372
373 spitzkbd->input = input_dev; 373 spitzkbd->input = input_dev;
374 374
375 input_dev->private = spitzkbd;
376 input_dev->name = "Spitz Keyboard"; 375 input_dev->name = "Spitz Keyboard";
377 input_dev->phys = spitzkbd->phys; 376 input_dev->phys = spitzkbd->phys;
378 input_dev->cdev.dev = &dev->dev; 377 input_dev->cdev.dev = &dev->dev;
diff --git a/drivers/input/keyboard/stowaway.c b/drivers/input/keyboard/stowaway.c
index f7b5c5b81451..c10962089398 100644
--- a/drivers/input/keyboard/stowaway.c
+++ b/drivers/input/keyboard/stowaway.c
@@ -109,7 +109,6 @@ static int skbd_connect(struct serio *serio, struct serio_driver *drv)
109 input_dev->id.product = 0x0001; 109 input_dev->id.product = 0x0001;
110 input_dev->id.version = 0x0100; 110 input_dev->id.version = 0x0100;
111 input_dev->cdev.dev = &serio->dev; 111 input_dev->cdev.dev = &serio->dev;
112 input_dev->private = skbd;
113 112
114 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 113 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
115 input_dev->keycode = skbd->keycode; 114 input_dev->keycode = skbd->keycode;
diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c
index cc0238366414..ca74b2bacb52 100644
--- a/drivers/input/keyboard/sunkbd.c
+++ b/drivers/input/keyboard/sunkbd.c
@@ -146,7 +146,7 @@ out:
146 146
147static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 147static int sunkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
148{ 148{
149 struct sunkbd *sunkbd = dev->private; 149 struct sunkbd *sunkbd = input_get_drvdata(dev);
150 150
151 switch (type) { 151 switch (type) {
152 152
@@ -272,7 +272,9 @@ static int sunkbd_connect(struct serio *serio, struct serio_driver *drv)
272 input_dev->id.product = sunkbd->type; 272 input_dev->id.product = sunkbd->type;
273 input_dev->id.version = 0x0100; 273 input_dev->id.version = 0x0100;
274 input_dev->cdev.dev = &serio->dev; 274 input_dev->cdev.dev = &serio->dev;
275 input_dev->private = sunkbd; 275
276 input_set_drvdata(input_dev, sunkbd);
277
276 input_dev->event = sunkbd_event; 278 input_dev->event = sunkbd_event;
277 279
278 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP); 280 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP);
diff --git a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c
index a82093432138..11d970881d97 100644
--- a/drivers/input/keyboard/xtkbd.c
+++ b/drivers/input/keyboard/xtkbd.c
@@ -109,7 +109,6 @@ static int xtkbd_connect(struct serio *serio, struct serio_driver *drv)
109 input_dev->id.product = 0x0001; 109 input_dev->id.product = 0x0001;
110 input_dev->id.version = 0x0100; 110 input_dev->id.version = 0x0100;
111 input_dev->cdev.dev = &serio->dev; 111 input_dev->cdev.dev = &serio->dev;
112 input_dev->private = xtkbd;
113 112
114 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 113 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
115 input_dev->keycode = xtkbd->keycode; 114 input_dev->keycode = xtkbd->keycode;