Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp137676rwb; Thu, 27 Jul 2023 10:24:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGWQgCGbhtyjTC76GQ9yI8ZgMG6YBVj1GaqOP/DGzRcwt7LHmhp5RO9XOGOBblp8y4LlFOV X-Received: by 2002:a17:907:7896:b0:993:d9a5:dafe with SMTP id ku22-20020a170907789600b00993d9a5dafemr2771845ejc.14.1690478673728; Thu, 27 Jul 2023 10:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690478673; cv=none; d=google.com; s=arc-20160816; b=YPuDrBgMZwA7mgbnLgjV10a7FZa4jxyh9t941ZmeFfeLnTlBPQifXDSu+sJa2S/1GA rUKB/nzCAsgMxYzyHJm/mPe2M9nEVXLbnp96co2jYnvAla0A+LBxmhNBN96Kz969Vmvb 490mRb9yhii1H7/TdqByILbgGZSJWFUQ9Dp2zIa7xJoS7VJMCo/VB4s1ILKMYn5ZM/2q 016HXu5nYMWiFYn118+DaXESJolwLtFMvtNydOduYEeqxT8h4cQ6mtyEeCNhKCvFd2t7 6Dtg8ST7+JyIiBVGDowlk+egcOyhjrthqXWVnUzjIUVGSXS1GIH6LyHQcCn9vPunS/fk fD6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xpbRNS/aBH+vUHcqU3ClTbBm181ehdQgwZL9TSbQYoo=; fh=1Zb+vPX4rrQkJByZfCDKF0WI7BIyJuqtnujqcZHUBPs=; b=pK4h9TmM1Q1ucqwQzbay8TNOsBzhjDoHhexYdQIcOHOxS8Tb6KbcF18g8JYcK1OBVs eD6ENtrhxSD/Wq8L5cgIkr0oeSPl9mM7PCcqXUlPKo29V5nbtA4s1jre5Wk1N0HqEI9H 2mnMjp9NeNv+c4mRDojUnQZDDAawew8vCKRe2SI/Y8nRcLNq4xrb/3WXEXBMtfF80yXN CMALaJKTwb1oX0ThgUvOapx97zcyukT84meqwcDpxY2t3ck4cQZrrgFJKuwrmdo/U/ES +Gt793WVLLEa6Ua6Wzf02liRzc9WsxtCaSIFH54Pj7lhvKhAMqpAu4afb0N5oGDIZo/6 MgbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CZwiNM9d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a1709064dc500b009889cad765dsi1511223ejw.352.2023.07.27.10.24.08; Thu, 27 Jul 2023 10:24:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CZwiNM9d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233175AbjG0ROb (ORCPT + 99 others); Thu, 27 Jul 2023 13:14:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232815AbjG0RN7 (ORCPT ); Thu, 27 Jul 2023 13:13:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7261C35A9; Thu, 27 Jul 2023 10:13:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 080BC61EF1; Thu, 27 Jul 2023 17:13:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5DBBC433C7; Thu, 27 Jul 2023 17:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690478028; bh=AFPKBytJ6Pj64+Tjq6KtRqZyi5jRmPsAML5BH0f/lII=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CZwiNM9dKZA3hV5kE0A/+mLhS9s1dTmgY4pM88f8JbXYBSSZzkDMTrPWKA8bJUYzS 6ENBJubS2033390jm83LqHwH2ew/uHOFfenb2MOkG7HClcsuSPWsrXnAuSpyeZ9IeO QYvmTh9z/l7o8+arR2tU3hkubhQ28lCz9yQcSVQly0qKLTpLsokZztnFNJb+rPWHKf ExsCURADVuOc25aflFVBBn0myLiK8dxnqqbPE4bBKCik59i0soamjKUITp9Ek9Ptid CKCjy0XhRfKo32LaSmJv8coN+0Dk21AJ37wpEvtjed2we3HAn+ZE/CPTl2ejR11WJq v+qnm/MY3SeAw== Date: Thu, 27 Jul 2023 19:13:45 +0200 From: Andi Shyti To: Harry Geyer Cc: Till Harbaum , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: tiny-usb: check usb base class before assuming the interface on device is for this driver Message-ID: <20230727171345.7u53kcfeadubvvlq@intel.intel> References: <20230727162255.21551-1-harry.geyer@devtank.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230727162255.21551-1-harry.geyer@devtank.co.uk> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Harry, On Thu, Jul 27, 2023 at 05:22:55PM +0100, Harry Geyer wrote: > Patch allows usb devices with multiple interfaces to use this driver without > this driver assuming all interfaces are i2c-tiny-usb. > > Signed-off-by: Harry Geyer > --- > drivers/i2c/busses/i2c-tiny-usb.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c > index d1fa9ff5aeab..1bffe36c40ad 100644 > --- a/drivers/i2c/busses/i2c-tiny-usb.c > +++ b/drivers/i2c/busses/i2c-tiny-usb.c > @@ -222,6 +222,10 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface, > int retval = -ENOMEM; > u16 version; > > + if (interface->intf_assoc && > + interface->intf_assoc->bFunctionClass != USB_CLASS_VENDOR_SPEC) > + return -ENODEV; > + Thanks for resending it! Reviewed-by: Andi Shyti Andi