Commit 3253f692 authored by Harry Geyer's avatar Harry Geyer Committed by Wolfram Sang
Browse files

i2c: tiny-usb: check usb base class before assuming the interface on device is for this driver



Patch allows usb devices with multiple interfaces to use this driver without
this driver assuming all interfaces are i2c-tiny-usb.

Signed-off-by: default avatarHarry Geyer <harry.geyer@devtank.co.uk>
Reviewed-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20230727162255.21551-1-harry.geyer@devtank.co.uk


Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 2ccdd1b1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;

	dev_dbg(&interface->dev, "probing usb device\n");

	/* allocate memory for our device state and initialize it */