diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2007-11-04 00:49:54 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-01-21 01:11:07 -0500 |
commit | 4615e33f43d3fad5fd92cd02757d23f7803dd7f9 (patch) | |
tree | 3c8eeb3c4614e28bc409674b85a3e495c88171f3 /drivers/input/joystick/iforce | |
parent | a8399c512b5fa2cf80831f5b4cd3adffd299fbe3 (diff) |
Input: iforce - don't access input_dev->private directly
input_{get|set}_drvdata() helpers should be used instead.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joystick/iforce')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index 6f826b37d9aa..a2517fa72eb8 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c | |||
@@ -85,7 +85,7 @@ static struct iforce_device iforce_device[] = { | |||
85 | 85 | ||
86 | static int iforce_playback(struct input_dev *dev, int effect_id, int value) | 86 | static int iforce_playback(struct input_dev *dev, int effect_id, int value) |
87 | { | 87 | { |
88 | struct iforce* iforce = dev->private; | 88 | struct iforce *iforce = input_get_drvdata(dev); |
89 | struct iforce_core_effect *core_effect = &iforce->core_effects[effect_id]; | 89 | struct iforce_core_effect *core_effect = &iforce->core_effects[effect_id]; |
90 | 90 | ||
91 | if (value > 0) | 91 | if (value > 0) |
@@ -99,7 +99,7 @@ static int iforce_playback(struct input_dev *dev, int effect_id, int value) | |||
99 | 99 | ||
100 | static void iforce_set_gain(struct input_dev *dev, u16 gain) | 100 | static void iforce_set_gain(struct input_dev *dev, u16 gain) |
101 | { | 101 | { |
102 | struct iforce* iforce = dev->private; | 102 | struct iforce *iforce = input_get_drvdata(dev); |
103 | unsigned char data[3]; | 103 | unsigned char data[3]; |
104 | 104 | ||
105 | data[0] = gain >> 9; | 105 | data[0] = gain >> 9; |
@@ -108,7 +108,7 @@ static void iforce_set_gain(struct input_dev *dev, u16 gain) | |||
108 | 108 | ||
109 | static void iforce_set_autocenter(struct input_dev *dev, u16 magnitude) | 109 | static void iforce_set_autocenter(struct input_dev *dev, u16 magnitude) |
110 | { | 110 | { |
111 | struct iforce* iforce = dev->private; | 111 | struct iforce *iforce = input_get_drvdata(dev); |
112 | unsigned char data[3]; | 112 | unsigned char data[3]; |
113 | 113 | ||
114 | data[0] = 0x03; | 114 | data[0] = 0x03; |
@@ -126,7 +126,7 @@ static void iforce_set_autocenter(struct input_dev *dev, u16 magnitude) | |||
126 | */ | 126 | */ |
127 | static int iforce_upload_effect(struct input_dev *dev, struct ff_effect *effect, struct ff_effect *old) | 127 | static int iforce_upload_effect(struct input_dev *dev, struct ff_effect *effect, struct ff_effect *old) |
128 | { | 128 | { |
129 | struct iforce* iforce = dev->private; | 129 | struct iforce *iforce = input_get_drvdata(dev); |
130 | struct iforce_core_effect *core_effect = &iforce->core_effects[effect->id]; | 130 | struct iforce_core_effect *core_effect = &iforce->core_effects[effect->id]; |
131 | int ret; | 131 | int ret; |
132 | 132 | ||
@@ -173,7 +173,7 @@ static int iforce_upload_effect(struct input_dev *dev, struct ff_effect *effect, | |||
173 | */ | 173 | */ |
174 | static int iforce_erase_effect(struct input_dev *dev, int effect_id) | 174 | static int iforce_erase_effect(struct input_dev *dev, int effect_id) |
175 | { | 175 | { |
176 | struct iforce *iforce = dev->private; | 176 | struct iforce *iforce = input_get_drvdata(dev); |
177 | struct iforce_core_effect *core_effect = &iforce->core_effects[effect_id]; | 177 | struct iforce_core_effect *core_effect = &iforce->core_effects[effect_id]; |
178 | int err = 0; | 178 | int err = 0; |
179 | 179 | ||
@@ -191,7 +191,7 @@ static int iforce_erase_effect(struct input_dev *dev, int effect_id) | |||
191 | 191 | ||
192 | static int iforce_open(struct input_dev *dev) | 192 | static int iforce_open(struct input_dev *dev) |
193 | { | 193 | { |
194 | struct iforce *iforce = dev->private; | 194 | struct iforce *iforce = input_get_drvdata(dev); |
195 | 195 | ||
196 | switch (iforce->bus) { | 196 | switch (iforce->bus) { |
197 | #ifdef CONFIG_JOYSTICK_IFORCE_USB | 197 | #ifdef CONFIG_JOYSTICK_IFORCE_USB |
@@ -213,7 +213,7 @@ static int iforce_open(struct input_dev *dev) | |||
213 | 213 | ||
214 | static void iforce_release(struct input_dev *dev) | 214 | static void iforce_release(struct input_dev *dev) |
215 | { | 215 | { |
216 | struct iforce *iforce = dev->private; | 216 | struct iforce *iforce = input_get_drvdata(dev); |
217 | int i; | 217 | int i; |
218 | 218 | ||
219 | if (test_bit(EV_FF, dev->evbit)) { | 219 | if (test_bit(EV_FF, dev->evbit)) { |
@@ -298,7 +298,8 @@ int iforce_init_device(struct iforce *iforce) | |||
298 | #endif | 298 | #endif |
299 | } | 299 | } |
300 | 300 | ||
301 | input_dev->private = iforce; | 301 | input_set_drvdata(input_dev, iforce); |
302 | |||
302 | input_dev->name = "Unknown I-Force device"; | 303 | input_dev->name = "Unknown I-Force device"; |
303 | input_dev->open = iforce_open; | 304 | input_dev->open = iforce_open; |
304 | input_dev->close = iforce_release; | 305 | input_dev->close = iforce_release; |