diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-09 04:17:31 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2007-05-09 04:17:31 -0400 |
commit | e071298589418076ef0a9813677f2d7032b65baa (patch) | |
tree | 1ec366c95456511dc0820aed22b333caf89e0a2d /drivers/hid/usbhid | |
parent | fed76ab3b206bd0c5a9e3be17cead0a22d7593c5 (diff) |
HID: switch to using input_dev->dev.parent
In preparation for struct class_device -> struct device input
core conversion switch to using input_dev->dev.parent when
specifying device position in sysfs tree.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-lgff.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-plff.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-tmff.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-zpff.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbkbd.c | 12 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbmouse.c | 9 |
7 files changed, 16 insertions, 15 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index d06b9e70ce6a..d91b9dac6dff 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -446,7 +446,7 @@ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, uns | |||
446 | 446 | ||
447 | static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) | 447 | static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) |
448 | { | 448 | { |
449 | struct hid_device *hid = dev->private; | 449 | struct hid_device *hid = input_get_drvdata(dev); |
450 | struct hid_field *field; | 450 | struct hid_field *field; |
451 | int offset; | 451 | int offset; |
452 | 452 | ||
diff --git a/drivers/hid/usbhid/hid-lgff.c b/drivers/hid/usbhid/hid-lgff.c index 92d2553f17b6..c5cd4107d6af 100644 --- a/drivers/hid/usbhid/hid-lgff.c +++ b/drivers/hid/usbhid/hid-lgff.c | |||
@@ -60,7 +60,7 @@ static const struct dev_type devices[] = { | |||
60 | 60 | ||
61 | static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect) | 61 | static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect) |
62 | { | 62 | { |
63 | struct hid_device *hid = dev->private; | 63 | struct hid_device *hid = input_get_drvdata(dev); |
64 | struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; | 64 | struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; |
65 | struct hid_report *report = list_entry(report_list->next, struct hid_report, list); | 65 | struct hid_report *report = list_entry(report_list->next, struct hid_report, list); |
66 | int x, y; | 66 | int x, y; |
diff --git a/drivers/hid/usbhid/hid-plff.c b/drivers/hid/usbhid/hid-plff.c index 76d2e6e14db4..d6a8f2b49bd2 100644 --- a/drivers/hid/usbhid/hid-plff.c +++ b/drivers/hid/usbhid/hid-plff.c | |||
@@ -37,7 +37,7 @@ struct plff_device { | |||
37 | static int hid_plff_play(struct input_dev *dev, void *data, | 37 | static int hid_plff_play(struct input_dev *dev, void *data, |
38 | struct ff_effect *effect) | 38 | struct ff_effect *effect) |
39 | { | 39 | { |
40 | struct hid_device *hid = dev->private; | 40 | struct hid_device *hid = input_get_drvdata(dev); |
41 | struct plff_device *plff = data; | 41 | struct plff_device *plff = data; |
42 | int left, right; | 42 | int left, right; |
43 | 43 | ||
diff --git a/drivers/hid/usbhid/hid-tmff.c b/drivers/hid/usbhid/hid-tmff.c index ab67331620d0..ab5ba6ef891c 100644 --- a/drivers/hid/usbhid/hid-tmff.c +++ b/drivers/hid/usbhid/hid-tmff.c | |||
@@ -59,7 +59,7 @@ static inline int hid_tmff_scale(unsigned int in, int minimum, int maximum) | |||
59 | 59 | ||
60 | static int hid_tmff_play(struct input_dev *dev, void *data, struct ff_effect *effect) | 60 | static int hid_tmff_play(struct input_dev *dev, void *data, struct ff_effect *effect) |
61 | { | 61 | { |
62 | struct hid_device *hid = dev->private; | 62 | struct hid_device *hid = input_get_drvdata(dev); |
63 | struct tmff_device *tmff = data; | 63 | struct tmff_device *tmff = data; |
64 | int left, right; /* Rumbling */ | 64 | int left, right; /* Rumbling */ |
65 | 65 | ||
diff --git a/drivers/hid/usbhid/hid-zpff.c b/drivers/hid/usbhid/hid-zpff.c index 7bd8238ca212..a7fbffcdaf36 100644 --- a/drivers/hid/usbhid/hid-zpff.c +++ b/drivers/hid/usbhid/hid-zpff.c | |||
@@ -37,7 +37,7 @@ struct zpff_device { | |||
37 | static int hid_zpff_play(struct input_dev *dev, void *data, | 37 | static int hid_zpff_play(struct input_dev *dev, void *data, |
38 | struct ff_effect *effect) | 38 | struct ff_effect *effect) |
39 | { | 39 | { |
40 | struct hid_device *hid = dev->private; | 40 | struct hid_device *hid = input_get_drvdata(dev); |
41 | struct zpff_device *zpff = data; | 41 | struct zpff_device *zpff = data; |
42 | int left, right; | 42 | int left, right; |
43 | 43 | ||
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index 36ddc7a7a427..130978780713 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c | |||
@@ -133,12 +133,11 @@ resubmit: | |||
133 | static int usb_kbd_event(struct input_dev *dev, unsigned int type, | 133 | static int usb_kbd_event(struct input_dev *dev, unsigned int type, |
134 | unsigned int code, int value) | 134 | unsigned int code, int value) |
135 | { | 135 | { |
136 | struct usb_kbd *kbd = dev->private; | 136 | struct usb_kbd *kbd = input_get_drvdata(dev); |
137 | 137 | ||
138 | if (type != EV_LED) | 138 | if (type != EV_LED) |
139 | return -1; | 139 | return -1; |
140 | 140 | ||
141 | |||
142 | kbd->newleds = (!!test_bit(LED_KANA, dev->led) << 3) | (!!test_bit(LED_COMPOSE, dev->led) << 3) | | 141 | kbd->newleds = (!!test_bit(LED_KANA, dev->led) << 3) | (!!test_bit(LED_COMPOSE, dev->led) << 3) | |
143 | (!!test_bit(LED_SCROLLL, dev->led) << 2) | (!!test_bit(LED_CAPSL, dev->led) << 1) | | 142 | (!!test_bit(LED_SCROLLL, dev->led) << 2) | (!!test_bit(LED_CAPSL, dev->led) << 1) | |
144 | (!!test_bit(LED_NUML, dev->led)); | 143 | (!!test_bit(LED_NUML, dev->led)); |
@@ -175,7 +174,7 @@ static void usb_kbd_led(struct urb *urb) | |||
175 | 174 | ||
176 | static int usb_kbd_open(struct input_dev *dev) | 175 | static int usb_kbd_open(struct input_dev *dev) |
177 | { | 176 | { |
178 | struct usb_kbd *kbd = dev->private; | 177 | struct usb_kbd *kbd = input_get_drvdata(dev); |
179 | 178 | ||
180 | kbd->irq->dev = kbd->usbdev; | 179 | kbd->irq->dev = kbd->usbdev; |
181 | if (usb_submit_urb(kbd->irq, GFP_KERNEL)) | 180 | if (usb_submit_urb(kbd->irq, GFP_KERNEL)) |
@@ -186,7 +185,7 @@ static int usb_kbd_open(struct input_dev *dev) | |||
186 | 185 | ||
187 | static void usb_kbd_close(struct input_dev *dev) | 186 | static void usb_kbd_close(struct input_dev *dev) |
188 | { | 187 | { |
189 | struct usb_kbd *kbd = dev->private; | 188 | struct usb_kbd *kbd = input_get_drvdata(dev); |
190 | 189 | ||
191 | usb_kill_urb(kbd->irq); | 190 | usb_kill_urb(kbd->irq); |
192 | } | 191 | } |
@@ -271,8 +270,9 @@ static int usb_kbd_probe(struct usb_interface *iface, | |||
271 | input_dev->name = kbd->name; | 270 | input_dev->name = kbd->name; |
272 | input_dev->phys = kbd->phys; | 271 | input_dev->phys = kbd->phys; |
273 | usb_to_input_id(dev, &input_dev->id); | 272 | usb_to_input_id(dev, &input_dev->id); |
274 | input_dev->cdev.dev = &iface->dev; | 273 | input_dev->dev.parent = &iface->dev; |
275 | input_dev->private = kbd; | 274 | |
275 | input_set_drvdata(input_dev, kbd); | ||
276 | 276 | ||
277 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); | 277 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); |
278 | input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL) | BIT(LED_COMPOSE) | BIT(LED_KANA); | 278 | input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL) | BIT(LED_COMPOSE) | BIT(LED_KANA); |
diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index 573776d865e1..5345c73bcf62 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c | |||
@@ -96,7 +96,7 @@ resubmit: | |||
96 | 96 | ||
97 | static int usb_mouse_open(struct input_dev *dev) | 97 | static int usb_mouse_open(struct input_dev *dev) |
98 | { | 98 | { |
99 | struct usb_mouse *mouse = dev->private; | 99 | struct usb_mouse *mouse = input_get_drvdata(dev); |
100 | 100 | ||
101 | mouse->irq->dev = mouse->usbdev; | 101 | mouse->irq->dev = mouse->usbdev; |
102 | if (usb_submit_urb(mouse->irq, GFP_KERNEL)) | 102 | if (usb_submit_urb(mouse->irq, GFP_KERNEL)) |
@@ -107,7 +107,7 @@ static int usb_mouse_open(struct input_dev *dev) | |||
107 | 107 | ||
108 | static void usb_mouse_close(struct input_dev *dev) | 108 | static void usb_mouse_close(struct input_dev *dev) |
109 | { | 109 | { |
110 | struct usb_mouse *mouse = dev->private; | 110 | struct usb_mouse *mouse = input_get_drvdata(dev); |
111 | 111 | ||
112 | usb_kill_urb(mouse->irq); | 112 | usb_kill_urb(mouse->irq); |
113 | } | 113 | } |
@@ -171,7 +171,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i | |||
171 | input_dev->name = mouse->name; | 171 | input_dev->name = mouse->name; |
172 | input_dev->phys = mouse->phys; | 172 | input_dev->phys = mouse->phys; |
173 | usb_to_input_id(dev, &input_dev->id); | 173 | usb_to_input_id(dev, &input_dev->id); |
174 | input_dev->cdev.dev = &intf->dev; | 174 | input_dev->dev.parent = &intf->dev; |
175 | 175 | ||
176 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); | 176 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); |
177 | input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); | 177 | input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); |
@@ -179,7 +179,8 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i | |||
179 | input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA); | 179 | input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA); |
180 | input_dev->relbit[0] |= BIT(REL_WHEEL); | 180 | input_dev->relbit[0] |= BIT(REL_WHEEL); |
181 | 181 | ||
182 | input_dev->private = mouse; | 182 | input_set_drvdata(input_dev, mouse); |
183 | |||
183 | input_dev->open = usb_mouse_open; | 184 | input_dev->open = usb_mouse_open; |
184 | input_dev->close = usb_mouse_close; | 185 | input_dev->close = usb_mouse_close; |
185 | 186 | ||