Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1666880ybv; Thu, 6 Feb 2020 07:46:47 -0800 (PST) X-Google-Smtp-Source: APXvYqyaswpeMfju11m53Fvvz7skh63wOCv4Ivs4bIHbZBs9HTK/bYdN6prX+l8ZJ9gdCEgZ/hrs X-Received: by 2002:aca:2114:: with SMTP id 20mr7544656oiz.9.1581004007068; Thu, 06 Feb 2020 07:46:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581004007; cv=none; d=google.com; s=arc-20160816; b=IyGBn4lpPuZn+0lTQEUlPchAkpQD4qQXfZGJP4Q0hbPzw9LItKxQ5KE45Rf3Scgs0Y De4mg6nBB3Yq9Xtda4KsSH4GqynAvAnHBMU7kFUT5bxInBkw47dX528AoqvqNp0AqExQ Etf6QgKc/8NA8JKwxzgddxJjekd8Y932MADBI63SY7kEReSBFXroe1bSaAlZVzGJnr3N JQVteRjpHGcGoXoEVpv8rVP1kGHUhzVyFaxrUV6kRultNB9mrUV8IHAE4bOeiFLOTYQK 9IbLD/qxPCl8vW3sIGRJ18B0ss0S9rvVHKZ2jx4jku/RSroJaw0ac0Z/54C2pVmmkenK /O/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=kaTqN3nWO1G19P530kLP07DoBvGWqGGiBIrx/AMs+wA=; b=eURmB4ezB9px8JLQ7+f7bLGJs8Ky2TN/x7uxsTvVc+AzdPuApj5EdouSDtOL68jDMv XBYJGy2VAggkaIKn1igtYIawmAb3DUTnM57TyKw3cEHzZRWZmNcXUfefMbBPswyJofeH 46mLGBuREKoCSXcHBsi+D2m9/ZmgYR0sb41gwLJ4HRQP4TctXmw3cGhb21yxTo6cSjZb gKxvBnDIaUj47PyCgCpmimPhhP/qGdTxM4VNxz2/mYd/bLBY/aCj3in/uXKDKPuGxVBN O4WdEsxAlNagjKfO/wWiHCM6+86LpzGgMpZaVpMiH8bPGO2p9/SXjl6SRNM1PRR3cCna Tzhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6si2102047otq.95.2020.02.06.07.46.34; Thu, 06 Feb 2020 07:46:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727563AbgBFPpb (ORCPT + 99 others); Thu, 6 Feb 2020 10:45:31 -0500 Received: from mx2.suse.de ([195.135.220.15]:36532 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbgBFPpa (ORCPT ); Thu, 6 Feb 2020 10:45:30 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3887DAAC3; Thu, 6 Feb 2020 15:45:29 +0000 (UTC) From: Takashi Iwai To: Hans Verkuil Cc: Mauro Carvalho Chehab , =?UTF-8?q?Josef=20M=C3=B6llers?= , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: go7007: Fix URB type for interrupt handling Date: Thu, 6 Feb 2020 16:45:27 +0100 Message-Id: <20200206154527.18171-1-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Josef reported that his old-and-good Plextor ConvertX M402U video converter spews lots of WARNINGs on the recent kernels, and it turned out that the device uses a bulk endpoint for interrupt handling just like 2250 board. For fixing it, generalize the check with the proper verification of the endpoint instead of hard-coded board type check. Fixes: 7e5219d18e93 ("[media] go7007: Fix 2250 urb type") Reported-and-tested-by: Josef Möllers BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1162583 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206427 Signed-off-by: Takashi Iwai --- drivers/media/usb/go7007/go7007-usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c index ff2aa057c1fb..f889c9d740cd 100644 --- a/drivers/media/usb/go7007/go7007-usb.c +++ b/drivers/media/usb/go7007/go7007-usb.c @@ -1044,6 +1044,7 @@ static int go7007_usb_probe(struct usb_interface *intf, struct go7007_usb *usb; const struct go7007_usb_board *board; struct usb_device *usbdev = interface_to_usbdev(intf); + struct usb_host_endpoint *ep; unsigned num_i2c_devs; char *name; int video_pipe, i, v_urb_len; @@ -1140,7 +1141,8 @@ static int go7007_usb_probe(struct usb_interface *intf, if (usb->intr_urb->transfer_buffer == NULL) goto allocfail; - if (go->board_id == GO7007_BOARDID_SENSORAY_2250) + ep = usb->usbdev->ep_in[4]; + if (usb_endpoint_type(&ep->desc) == USB_ENDPOINT_XFER_BULK) usb_fill_bulk_urb(usb->intr_urb, usb->usbdev, usb_rcvbulkpipe(usb->usbdev, 4), usb->intr_urb->transfer_buffer, 2*sizeof(u16), -- 2.16.4