Commits
Ajay Agarwal committed 852619242c9
ANDROID: usb: gadget: configfs: Support multiple android instances Some platforms may choose to create more than one gadget ConfigFS instance, often due to the hardware having multiple USB gadget controllers which can be used simultaneously. Currently android_device_create() assumes only one gadget instance is ever created and creates a single "android0" device under the "android_usb" class, resulting in a crash if a second gadget is registered since the global android_device pointer gets overwritten with -EEXIST. Fix this by properly supporting multiple instances and naming the devices "android0", "android1", etc. when each instance is created (via mkdir). For now keep the global singleton android_device pointing to android0 for ease of use since f_midi and f_audio_source currently use create_function_device() without any context as to which gadget they will be bound to. Bug: 120441124 Fixes: 429213f5d9eb ("ANDROID: usb: gadget: configfs: Add function devices to the parent") Change-Id: Idae6f6d0d8811f27e836f5f6399395a15fbf3c2f Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org> [jackp@codeaurora.org: reworded commit text] Signed-off-by: Jack Pham <jackp@codeaurora.org>