From patchwork Tue Mar 22 15:04:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 8643571 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5AE0C0553 for ; Tue, 22 Mar 2016 15:07:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7D45201F5 for ; Tue, 22 Mar 2016 15:07:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB480201DD for ; Tue, 22 Mar 2016 15:07:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751493AbcCVPHx (ORCPT ); Tue, 22 Mar 2016 11:07:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:56295 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbcCVPHv (ORCPT ); Tue, 22 Mar 2016 11:07:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7A34EACB4; Tue, 22 Mar 2016 15:07:48 +0000 (UTC) From: Oliver Neukum To: linux-usb@vger.kernel.org, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Cc: Oliver Neukum Subject: [PATCH 2/4] aiptek: stop saving struct usb_device Date: Tue, 22 Mar 2016 16:04:55 +0100 Message-Id: <1458659097-8213-3-git-send-email-oneukum@suse.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458659097-8213-1-git-send-email-oneukum@suse.com> References: <1458659097-8213-1-git-send-email-oneukum@suse.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The device can now easily be derived from the interface. Stop leaving a private copy. Signed-off-by: Oliver Neukum --- drivers/input/tablet/aiptek.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 78ca448..ee80c11 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c @@ -307,7 +307,6 @@ struct aiptek_settings { struct aiptek { struct input_dev *inputdev; /* input device struct */ - struct usb_device *usbdev; /* usb device struct */ struct usb_interface *intf; /* usb interface struct */ struct urb *urb; /* urb for incoming reports */ dma_addr_t data_dma; /* our dma stuffage */ @@ -847,7 +846,7 @@ static int aiptek_open(struct input_dev *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) return -EIO; @@ -873,8 +872,9 @@ aiptek_set_report(struct aiptek *aiptek, unsigned char report_type, unsigned char report_id, void *buffer, int size) { - return usb_control_msg(aiptek->usbdev, - usb_sndctrlpipe(aiptek->usbdev, 0), + struct usb_device *udev = interface_to_usbdev(aiptek->intf); + return usb_control_msg(udev, + usb_sndctrlpipe(udev, 0), USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT, (report_type << 8) + report_id, @@ -886,8 +886,9 @@ aiptek_get_report(struct aiptek *aiptek, unsigned char report_type, unsigned char report_id, void *buffer, int size) { - return usb_control_msg(aiptek->usbdev, - usb_rcvctrlpipe(aiptek->usbdev, 0), + struct usb_device *udev = interface_to_usbdev(aiptek->intf); + return usb_control_msg(udev, + usb_rcvctrlpipe(udev, 0), USB_REQ_GET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, (report_type << 8) + report_id, @@ -1729,7 +1730,6 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) } aiptek->inputdev = inputdev; - aiptek->usbdev = usbdev; aiptek->intf = intf; aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber; aiptek->inDelay = 0; @@ -1833,8 +1833,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) * input. */ usb_fill_int_urb(aiptek->urb, - aiptek->usbdev, - usb_rcvintpipe(aiptek->usbdev, + usbdev, + usb_rcvintpipe(usbdev, endpoint->bEndpointAddress), aiptek->data, 8, aiptek_irq, aiptek, endpoint->bInterval);