From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 546B7C0015E for ; Wed, 26 Jul 2023 16:08:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231475AbjGZQIu (ORCPT ); Wed, 26 Jul 2023 12:08:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231367AbjGZQIs (ORCPT ); Wed, 26 Jul 2023 12:08:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91A2B19B6; Wed, 26 Jul 2023 09:08:47 -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 223BF61B9F; Wed, 26 Jul 2023 16:08:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28181C433C8; Wed, 26 Jul 2023 16:08:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690387726; bh=CcsaPxYgQ949an1s9anQMlRQJgSeJG8aDntwjOIFDEE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uF8+Hz7GzjwLAQmgWkV8X9GjI3nff5YhwNh4L7+dWXLT30hTZ46qXJ+qls5EMKkCh KvufQmby6HVSEtKBOIOTJiUEk6C2orpLFU+nZawn4RKwurhYYodkizuzI1nC4E3+ji wo1WL4c2X9/vtRBvsl+KjsBGOQHnRfoY3FrEoWTCPiAOLt9df4pDMdHLAaCbTqwQ+1 29Rrh/Hoq94h4e40OOuyeR3TD3cTuz+jCcWyZwmFmcq/mg6EWBjjW9ONq7d3UEYWhl 2fWoizg25BF7Hng6medX7x3B2U2AHnErp6llOPkMvpM3MEXYjSdTMViVrvprAOI2LX ZQ6UtiMVLDrTA== Date: Wed, 26 Jul 2023 18:08:43 +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: <20230726160843.sbutc7g7nrn5g7rh@intel.intel> References: <20230719113838.17714-1-harry.geyer@devtank.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230719113838.17714-1-harry.geyer@devtank.co.uk> Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Hi Harry, it's OK, just few little adjustments... On Wed, Jul 19, 2023 at 12:38:38PM +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 Please add: Fixes: e8c76eed2ecd ("i2c: New i2c-tiny-usb bus driver") Cc: Till Harbaum Cc: # v2.6.22+ > --- > drivers/i2c/busses/i2c-tiny-usb.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c > index d1fa9ff5aeab..fc194c65e50e 100644 > --- a/drivers/i2c/busses/i2c-tiny-usb.c > +++ b/drivers/i2c/busses/i2c-tiny-usb.c > @@ -222,6 +222,11 @@ 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) { please fix the indentation here ('interface' and 'interface' should go on the same line) > + return -ENODEV; > + } please drop the brackets. Andi > + > dev_dbg(&interface->dev, "probing usb device\n"); > > /* allocate memory for our device state and initialize it */ > -- > 2.34.1 >