Commit c6309018 authored by Oliver Neukum's avatar Oliver Neukum Committed by Dmitry Torokhov

Input: aiptek - stop saving struct usb_device

The device can now easily be derived from the interface.
Stop leaving a private copy.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 7edf2c9c
...@@ -307,7 +307,6 @@ struct aiptek_settings { ...@@ -307,7 +307,6 @@ struct aiptek_settings {
struct aiptek { struct aiptek {
struct input_dev *inputdev; /* input device struct */ struct input_dev *inputdev; /* input device struct */
struct usb_device *usbdev; /* usb device struct */
struct usb_interface *intf; /* usb interface struct */ struct usb_interface *intf; /* usb interface struct */
struct urb *urb; /* urb for incoming reports */ struct urb *urb; /* urb for incoming reports */
dma_addr_t data_dma; /* our dma stuffage */ dma_addr_t data_dma; /* our dma stuffage */
...@@ -847,7 +846,7 @@ static int aiptek_open(struct input_dev *inputdev) ...@@ -847,7 +846,7 @@ static int aiptek_open(struct input_dev *inputdev)
{ {
struct aiptek *aiptek = input_get_drvdata(inputdev); struct aiptek *aiptek = input_get_drvdata(inputdev);
aiptek->urb->dev = aiptek->usbdev; aiptek->urb->dev = interface_to_usbdev(aiptek->intf);
if (usb_submit_urb(aiptek->urb, GFP_KERNEL) != 0) if (usb_submit_urb(aiptek->urb, GFP_KERNEL) != 0)
return -EIO; return -EIO;
...@@ -873,8 +872,10 @@ aiptek_set_report(struct aiptek *aiptek, ...@@ -873,8 +872,10 @@ aiptek_set_report(struct aiptek *aiptek,
unsigned char report_type, unsigned char report_type,
unsigned char report_id, void *buffer, int size) unsigned char report_id, void *buffer, int size)
{ {
return usb_control_msg(aiptek->usbdev, struct usb_device *udev = interface_to_usbdev(aiptek->intf);
usb_sndctrlpipe(aiptek->usbdev, 0),
return usb_control_msg(udev,
usb_sndctrlpipe(udev, 0),
USB_REQ_SET_REPORT, USB_REQ_SET_REPORT,
USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_RECIP_INTERFACE |
USB_DIR_OUT, (report_type << 8) + report_id, USB_DIR_OUT, (report_type << 8) + report_id,
...@@ -886,8 +887,10 @@ aiptek_get_report(struct aiptek *aiptek, ...@@ -886,8 +887,10 @@ aiptek_get_report(struct aiptek *aiptek,
unsigned char report_type, unsigned char report_type,
unsigned char report_id, void *buffer, int size) unsigned char report_id, void *buffer, int size)
{ {
return usb_control_msg(aiptek->usbdev, struct usb_device *udev = interface_to_usbdev(aiptek->intf);
usb_rcvctrlpipe(aiptek->usbdev, 0),
return usb_control_msg(udev,
usb_rcvctrlpipe(udev, 0),
USB_REQ_GET_REPORT, USB_REQ_GET_REPORT,
USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_RECIP_INTERFACE |
USB_DIR_IN, (report_type << 8) + report_id, USB_DIR_IN, (report_type << 8) + report_id,
...@@ -1729,7 +1732,6 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -1729,7 +1732,6 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
} }
aiptek->inputdev = inputdev; aiptek->inputdev = inputdev;
aiptek->usbdev = usbdev;
aiptek->intf = intf; aiptek->intf = intf;
aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber; aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber;
aiptek->inDelay = 0; aiptek->inDelay = 0;
...@@ -1833,8 +1835,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -1833,8 +1835,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
* input. * input.
*/ */
usb_fill_int_urb(aiptek->urb, usb_fill_int_urb(aiptek->urb,
aiptek->usbdev, usbdev,
usb_rcvintpipe(aiptek->usbdev, usb_rcvintpipe(usbdev,
endpoint->bEndpointAddress), endpoint->bEndpointAddress),
aiptek->data, 8, aiptek_irq, aiptek, aiptek->data, 8, aiptek_irq, aiptek,
endpoint->bInterval); endpoint->bInterval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment