OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ccdd1b
)
i2c: tiny-usb: check usb base class before assuming the interface on device is for...
author
Harry Geyer
<harry.geyer@devtank.co.uk>
Thu, 27 Jul 2023 16:22:55 +0000
(17:22 +0100)
committer
Wolfram Sang
<wsa@kernel.org>
Mon, 14 Aug 2023 13:14:42 +0000
(15:14 +0200)
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@devtank.co.uk>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Link:
https://lore.kernel.org/r/20230727162255.21551-1-harry.geyer@devtank.co.uk
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-tiny-usb.c
patch
|
blob
|
history
diff --git
a/drivers/i2c/busses/i2c-tiny-usb.c
b/drivers/i2c/busses/i2c-tiny-usb.c
index
d1fa9ff
..
1bffe36
100644
(file)
--- 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;
+
dev_dbg(&interface->dev, "probing usb device\n");
/* allocate memory for our device state and initialize it */