Commit 7fb673f0 authored by Roy Luo's avatar Roy Luo Committed by Greg Kroah-Hartman
Browse files

USB: gadget: core: create sysfs link between udc and gadget



[ Upstream commit 0ef40f39 ]

udc device and gadget device are tightly coupled, yet there's no good
way to corelate the two. Add a sysfs link in udc that points to the
corresponding gadget device.
An example use case: userspace configures a f_midi configfs driver and
bind the udc device, then it tries to locate the corresponding midi
device, which is a child device of the gadget device. The gadget device
that's associated to the udc device has to be identified in order to
index the midi device. Having a sysfs link would make things much
easier.

Signed-off-by: default avatarRoy Luo <royluo@google.com>
Link: https://lore.kernel.org/r/20240307030922.3573161-1-royluo@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 399a45e5 ("usb: gadget: core: flush gadget workqueue after device removal")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ac18d781
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment