From f138b560d235e20b8fa1249473bed93268880af5 Mon Sep 17 00:00:00 2001 From: jiangjianghu <35681477+jiangjianghu@users.noreply.github.com> Date: Fri, 12 Jun 2026 18:37:55 +0800 Subject: [PATCH] usb: gadget: fix: android_device_create Fixed uninstallation failure caused by creating multiple devices in android_device_create with the same device number --- drivers/usb/gadget/configfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index c5db03466f398..70a09cf6c3599 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1776,9 +1776,11 @@ static int android_device_create(struct gadget_info *gi) struct device_attribute **attrs; struct device_attribute *attr; + dev_t devt = MKDEV(0, gadget_index); + INIT_WORK(&gi->work, android_work); gi->dev = device_create(android_class, NULL, - MKDEV(0, 0), NULL, "android%d", gadget_index++); + devt, NULL, "android%d", gadget_index++); if (IS_ERR(gi->dev)) return PTR_ERR(gi->dev);