[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230727171345.7u53kcfeadubvvlq@intel.intel>
Date: Thu, 27 Jul 2023 19:13:45 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: Harry Geyer <harry.geyer@...tank.co.uk>
Cc: Till Harbaum <till@...baum.org>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: tiny-usb: check usb base class before assuming the
interface on device is for this driver
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 <harry.geyer@...tank.co.uk>
> ---
> 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.shyti@...nel.org>
Andi
Powered by blists - more mailing lists