diff options
Diffstat (limited to 'drivers/usb/input/hid-core.c')
-rw-r--r-- | drivers/usb/input/hid-core.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 0350218d71d..521047bcc46 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -106,18 +106,18 @@ static void hid_reset(struct work_struct *work) | |||
106 | 106 | ||
107 | if (test_bit(HID_CLEAR_HALT, &usbhid->iofl)) { | 107 | if (test_bit(HID_CLEAR_HALT, &usbhid->iofl)) { |
108 | dev_dbg(&usbhid->intf->dev, "clear halt\n"); | 108 | dev_dbg(&usbhid->intf->dev, "clear halt\n"); |
109 | rc = usb_clear_halt(to_usb_device(hid->dev), usbhid->urbin->pipe); | 109 | rc = usb_clear_halt(hid_to_usb_dev(hid), usbhid->urbin->pipe); |
110 | clear_bit(HID_CLEAR_HALT, &usbhid->iofl); | 110 | clear_bit(HID_CLEAR_HALT, &usbhid->iofl); |
111 | hid_start_in(hid); | 111 | hid_start_in(hid); |
112 | } | 112 | } |
113 | 113 | ||
114 | else if (test_bit(HID_RESET_PENDING, &usbhid->iofl)) { | 114 | else if (test_bit(HID_RESET_PENDING, &usbhid->iofl)) { |
115 | dev_dbg(&usbhid->intf->dev, "resetting device\n"); | 115 | dev_dbg(&usbhid->intf->dev, "resetting device\n"); |
116 | rc = rc_lock = usb_lock_device_for_reset(to_usb_device(hid->dev), usbhid->intf); | 116 | rc = rc_lock = usb_lock_device_for_reset(hid_to_usb_dev(hid), usbhid->intf); |
117 | if (rc_lock >= 0) { | 117 | if (rc_lock >= 0) { |
118 | rc = usb_reset_composite_device(to_usb_device(hid->dev), usbhid->intf); | 118 | rc = usb_reset_composite_device(hid_to_usb_dev(hid), usbhid->intf); |
119 | if (rc_lock) | 119 | if (rc_lock) |
120 | usb_unlock_device(to_usb_device(hid->dev)); | 120 | usb_unlock_device(hid_to_usb_dev(hid)); |
121 | } | 121 | } |
122 | clear_bit(HID_RESET_PENDING, &usbhid->iofl); | 122 | clear_bit(HID_RESET_PENDING, &usbhid->iofl); |
123 | } | 123 | } |
@@ -129,8 +129,8 @@ static void hid_reset(struct work_struct *work) | |||
129 | break; | 129 | break; |
130 | default: | 130 | default: |
131 | err("can't reset device, %s-%s/input%d, status %d", | 131 | err("can't reset device, %s-%s/input%d, status %d", |
132 | to_usb_device(hid->dev)->bus->bus_name, | 132 | hid_to_usb_dev(hid)->bus->bus_name, |
133 | to_usb_device(hid->dev)->devpath, | 133 | hid_to_usb_dev(hid)->devpath, |
134 | usbhid->ifnum, rc); | 134 | usbhid->ifnum, rc); |
135 | /* FALLTHROUGH */ | 135 | /* FALLTHROUGH */ |
136 | case -EHOSTUNREACH: | 136 | case -EHOSTUNREACH: |
@@ -217,8 +217,8 @@ static void hid_irq_in(struct urb *urb) | |||
217 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); | 217 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); |
218 | if (status != -EPERM) { | 218 | if (status != -EPERM) { |
219 | err("can't resubmit intr, %s-%s/input%d, status %d", | 219 | err("can't resubmit intr, %s-%s/input%d, status %d", |
220 | to_usb_device(hid->dev)->bus->bus_name, | 220 | hid_to_usb_dev(hid)->bus->bus_name, |
221 | to_usb_device(hid->dev)->devpath, | 221 | hid_to_usb_dev(hid)->devpath, |
222 | usbhid->ifnum, status); | 222 | usbhid->ifnum, status); |
223 | hid_io_error(hid); | 223 | hid_io_error(hid); |
224 | } | 224 | } |
@@ -251,7 +251,7 @@ static int hid_submit_out(struct hid_device *hid) | |||
251 | 251 | ||
252 | hid_output_report(report, usbhid->outbuf); | 252 | hid_output_report(report, usbhid->outbuf); |
253 | usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0); | 253 | usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0); |
254 | usbhid->urbout->dev = to_usb_device(hid->dev); | 254 | usbhid->urbout->dev = hid_to_usb_dev(hid); |
255 | 255 | ||
256 | dbg("submitting out urb"); | 256 | dbg("submitting out urb"); |
257 | 257 | ||
@@ -276,13 +276,13 @@ static int hid_submit_ctrl(struct hid_device *hid) | |||
276 | len = ((report->size - 1) >> 3) + 1 + (report->id > 0); | 276 | len = ((report->size - 1) >> 3) + 1 + (report->id > 0); |
277 | if (dir == USB_DIR_OUT) { | 277 | if (dir == USB_DIR_OUT) { |
278 | hid_output_report(report, usbhid->ctrlbuf); | 278 | hid_output_report(report, usbhid->ctrlbuf); |
279 | usbhid->urbctrl->pipe = usb_sndctrlpipe(to_usb_device(hid->dev), 0); | 279 | usbhid->urbctrl->pipe = usb_sndctrlpipe(hid_to_usb_dev(hid), 0); |
280 | usbhid->urbctrl->transfer_buffer_length = len; | 280 | usbhid->urbctrl->transfer_buffer_length = len; |
281 | } else { | 281 | } else { |
282 | int maxpacket, padlen; | 282 | int maxpacket, padlen; |
283 | 283 | ||
284 | usbhid->urbctrl->pipe = usb_rcvctrlpipe(to_usb_device(hid->dev), 0); | 284 | usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0); |
285 | maxpacket = usb_maxpacket(to_usb_device(hid->dev), usbhid->urbctrl->pipe, 0); | 285 | maxpacket = usb_maxpacket(hid_to_usb_dev(hid), usbhid->urbctrl->pipe, 0); |
286 | if (maxpacket > 0) { | 286 | if (maxpacket > 0) { |
287 | padlen = (len + maxpacket - 1) / maxpacket; | 287 | padlen = (len + maxpacket - 1) / maxpacket; |
288 | padlen *= maxpacket; | 288 | padlen *= maxpacket; |
@@ -292,7 +292,7 @@ static int hid_submit_ctrl(struct hid_device *hid) | |||
292 | padlen = 0; | 292 | padlen = 0; |
293 | usbhid->urbctrl->transfer_buffer_length = padlen; | 293 | usbhid->urbctrl->transfer_buffer_length = padlen; |
294 | } | 294 | } |
295 | usbhid->urbctrl->dev = to_usb_device(hid->dev); | 295 | usbhid->urbctrl->dev = hid_to_usb_dev(hid); |
296 | 296 | ||
297 | usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir; | 297 | usbhid->cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE | dir; |
298 | usbhid->cr->bRequest = (dir == USB_DIR_OUT) ? HID_REQ_SET_REPORT : HID_REQ_GET_REPORT; | 298 | usbhid->cr->bRequest = (dir == USB_DIR_OUT) ? HID_REQ_SET_REPORT : HID_REQ_GET_REPORT; |
@@ -1187,7 +1187,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1187 | 1187 | ||
1188 | hid->version = le16_to_cpu(hdesc->bcdHID); | 1188 | hid->version = le16_to_cpu(hdesc->bcdHID); |
1189 | hid->country = hdesc->bCountryCode; | 1189 | hid->country = hdesc->bCountryCode; |
1190 | hid->dev = &dev->dev; | 1190 | hid->dev = &intf->dev; |
1191 | usbhid->intf = intf; | 1191 | usbhid->intf = intf; |
1192 | usbhid->ifnum = interface->desc.bInterfaceNumber; | 1192 | usbhid->ifnum = interface->desc.bInterfaceNumber; |
1193 | 1193 | ||
@@ -1282,7 +1282,7 @@ static void hid_disconnect(struct usb_interface *intf) | |||
1282 | usb_free_urb(usbhid->urbctrl); | 1282 | usb_free_urb(usbhid->urbctrl); |
1283 | usb_free_urb(usbhid->urbout); | 1283 | usb_free_urb(usbhid->urbout); |
1284 | 1284 | ||
1285 | hid_free_buffers(to_usb_device(hid->dev), hid); | 1285 | hid_free_buffers(hid_to_usb_dev(hid), hid); |
1286 | hid_free_device(hid); | 1286 | hid_free_device(hid); |
1287 | } | 1287 | } |
1288 | 1288 | ||