aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2013-09-11 16:12:25 -0400
committerJiri Kosina <jkosina@suse.cz>2013-09-24 05:47:48 -0400
commitf204828a1150b0f35730556cd493febda011caf1 (patch)
tree332d02faf9819592b54a9df265e610dae8c99757
parent0c5218362b429ab9cbf295dfe069ce410d180493 (diff)
HID: sony: use hid_get_raw_report() instead of a direct call to usb
The usb packets are exactly the same, but it makes it a little bit more independent of the transport layer. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-sony.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b18320db5f7d..bc37a1800166 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -419,21 +419,14 @@ static int sixaxis_usb_output_raw_report(struct hid_device *hid, __u8 *buf,
419 */ 419 */
420static int sixaxis_set_operational_usb(struct hid_device *hdev) 420static int sixaxis_set_operational_usb(struct hid_device *hdev)
421{ 421{
422 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
423 struct usb_device *dev = interface_to_usbdev(intf);
424 __u16 ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
425 int ret; 422 int ret;
426 char *buf = kmalloc(18, GFP_KERNEL); 423 char *buf = kmalloc(18, GFP_KERNEL);
427 424
428 if (!buf) 425 if (!buf)
429 return -ENOMEM; 426 return -ENOMEM;
430 427
431 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 428 ret = hdev->hid_get_raw_report(hdev, 0xf2, buf, 17, HID_FEATURE_REPORT);
432 HID_REQ_GET_REPORT, 429
433 USB_DIR_IN | USB_TYPE_CLASS |
434 USB_RECIP_INTERFACE,
435 (3 << 8) | 0xf2, ifnum, buf, 17,
436 USB_CTRL_GET_TIMEOUT);
437 if (ret < 0) 430 if (ret < 0)
438 hid_err(hdev, "can't set operational mode\n"); 431 hid_err(hdev, "can't set operational mode\n");
439 432