aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid/usbmouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/usbhid/usbmouse.c')
-rw-r--r--drivers/hid/usbhid/usbmouse.c9
1 files changed, 5 insertions, 4 deletions
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
97static int usb_mouse_open(struct input_dev *dev) 97static 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
108static void usb_mouse_close(struct input_dev *dev) 108static 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