From patchwork Tue Mar 22 15:04:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 8643581 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D27259F294 for ; Tue, 22 Mar 2016 15:07:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFF992037C for ; Tue, 22 Mar 2016 15:07:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81FA9202E5 for ; Tue, 22 Mar 2016 15:07:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755312AbcCVPH4 (ORCPT ); Tue, 22 Mar 2016 11:07:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:56299 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377AbcCVPHv (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 87F3BAD8A; 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 , Oliver Neukum Subject: [PATCH 4/4] kbtab: stop saving struct usb_device Date: Tue, 22 Mar 2016 16:04:57 +0100 Message-Id: <1458659097-8213-5-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/kbtab.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index d2ac7c2..e850d7e 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c @@ -31,7 +31,6 @@ struct kbtab { unsigned char *data; dma_addr_t data_dma; struct input_dev *dev; - struct usb_device *usbdev; struct usb_interface *intf; struct urb *irq; char phys[32]; @@ -99,8 +98,9 @@ MODULE_DEVICE_TABLE(usb, kbtab_ids); static int kbtab_open(struct input_dev *dev) { struct kbtab *kbtab = input_get_drvdata(dev); + struct usb_device *udev = interface_to_usbdev(kbtab->intf); - kbtab->irq->dev = kbtab->usbdev; + kbtab->irq->dev = udev; if (usb_submit_urb(kbtab->irq, GFP_KERNEL)) return -EIO; @@ -135,7 +135,6 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i if (!kbtab->irq) goto fail2; - kbtab->usbdev = dev; kbtab->intf = intf; kbtab->dev = input_dev; @@ -188,12 +187,13 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i static void kbtab_disconnect(struct usb_interface *intf) { struct kbtab *kbtab = usb_get_intfdata(intf); + struct usb_device *udev = interface_to_usbdev(intf); usb_set_intfdata(intf, NULL); input_unregister_device(kbtab->dev); usb_free_urb(kbtab->irq); - usb_free_coherent(kbtab->usbdev, 8, kbtab->data, kbtab->data_dma); + usb_free_coherent(udev, 8, kbtab->data, kbtab->data_dma); kfree(kbtab); }