aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-04-12 01:34:33 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-04-12 01:34:33 -0400
commit373f9713dccc8fc8e076157001a60133455c0550 (patch)
tree509c52d79867b6614a750bba582e067db03d4419 /drivers/input/misc
parentb356872fa48a3f6b6f187444b0ea55e6e21c3575 (diff)
Input: drivers/input/misc - 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/misc')
-rw-r--r--drivers/input/misc/ixp4xx-beeper.c9
-rw-r--r--drivers/input/misc/uinput.c10
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c
index 105c6fc27823..da6650caf7b5 100644
--- a/drivers/input/misc/ixp4xx-beeper.c
+++ b/drivers/input/misc/ixp4xx-beeper.c
@@ -51,7 +51,7 @@ static void ixp4xx_spkr_control(unsigned int pin, unsigned int count)
51 51
52static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 52static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
53{ 53{
54 unsigned int pin = (unsigned int) dev->private; 54 unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
55 unsigned int count = 0; 55 unsigned int count = 0;
56 56
57 if (type != EV_SND) 57 if (type != EV_SND)
@@ -99,7 +99,8 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev)
99 if (!input_dev) 99 if (!input_dev)
100 return -ENOMEM; 100 return -ENOMEM;
101 101
102 input_dev->private = (void *) dev->id; 102 input_set_drvdata(input_dev, (void *) dev->id);
103
103 input_dev->name = "ixp4xx beeper", 104 input_dev->name = "ixp4xx beeper",
104 input_dev->phys = "ixp4xx/gpio"; 105 input_dev->phys = "ixp4xx/gpio";
105 input_dev->id.bustype = BUS_HOST; 106 input_dev->id.bustype = BUS_HOST;
@@ -136,7 +137,7 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev)
136static int __devexit ixp4xx_spkr_remove(struct platform_device *dev) 137static int __devexit ixp4xx_spkr_remove(struct platform_device *dev)
137{ 138{
138 struct input_dev *input_dev = platform_get_drvdata(dev); 139 struct input_dev *input_dev = platform_get_drvdata(dev);
139 unsigned int pin = (unsigned int) input_dev->private; 140 unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
140 141
141 input_unregister_device(input_dev); 142 input_unregister_device(input_dev);
142 platform_set_drvdata(dev, NULL); 143 platform_set_drvdata(dev, NULL);
@@ -153,7 +154,7 @@ static int __devexit ixp4xx_spkr_remove(struct platform_device *dev)
153static void ixp4xx_spkr_shutdown(struct platform_device *dev) 154static void ixp4xx_spkr_shutdown(struct platform_device *dev)
154{ 155{
155 struct input_dev *input_dev = platform_get_drvdata(dev); 156 struct input_dev *input_dev = platform_get_drvdata(dev);
156 unsigned int pin = (unsigned int) input_dev->private; 157 unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
157 158
158 /* turn off the speaker */ 159 /* turn off the speaker */
159 disable_irq(IRQ_IXP4XX_TIMER2); 160 disable_irq(IRQ_IXP4XX_TIMER2);
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 42556232c523..031467eadd31 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -41,9 +41,7 @@
41 41
42static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 42static int uinput_dev_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
43{ 43{
44 struct uinput_device *udev; 44 struct uinput_device *udev = input_get_drvdata(dev);
45
46 udev = dev->private;
47 45
48 udev->buff[udev->head].type = type; 46 udev->buff[udev->head].type = type;
49 udev->buff[udev->head].code = code; 47 udev->buff[udev->head].code = code;
@@ -136,7 +134,7 @@ static int uinput_dev_upload_effect(struct input_dev *dev, struct ff_effect *eff
136 request.u.upload.effect = effect; 134 request.u.upload.effect = effect;
137 request.u.upload.old = old; 135 request.u.upload.old = old;
138 136
139 retval = uinput_request_reserve_slot(dev->private, &request); 137 retval = uinput_request_reserve_slot(input_get_drvdata(dev), &request);
140 if (!retval) 138 if (!retval)
141 retval = uinput_request_submit(dev, &request); 139 retval = uinput_request_submit(dev, &request);
142 140
@@ -156,7 +154,7 @@ static int uinput_dev_erase_effect(struct input_dev *dev, int effect_id)
156 request.code = UI_FF_ERASE; 154 request.code = UI_FF_ERASE;
157 request.u.effect_id = effect_id; 155 request.u.effect_id = effect_id;
158 156
159 retval = uinput_request_reserve_slot(dev->private, &request); 157 retval = uinput_request_reserve_slot(input_get_drvdata(dev), &request);
160 if (!retval) 158 if (!retval)
161 retval = uinput_request_submit(dev, &request); 159 retval = uinput_request_submit(dev, &request);
162 160
@@ -274,7 +272,7 @@ static int uinput_allocate_device(struct uinput_device *udev)
274 return -ENOMEM; 272 return -ENOMEM;
275 273
276 udev->dev->event = uinput_dev_event; 274 udev->dev->event = uinput_dev_event;
277 udev->dev->private = udev; 275 input_set_drvdata(udev->dev, udev);
278 276
279 return 0; 277 return 0;
280} 278}