RE: [EXT] Re: [PATCH v2] USB: gadget: Add ID numbers to configfs-gadget driver names

From: Frank Li
Date: Sat Dec 24 2022 - 22:07:28 EST


>
> I'm wondering if it maybe makes more sense to use the gadget name as a
> suffix
> instead?
>
> gi->composite.gadget_driver.driver.name =
> kasprintf(GFP_KERNEL, "configfs-gadget.%s" name);
>
> So that when you
>
> mkdir g1
>
> you will ultimately see /sys/bus/gadget/drivers/configfs-gadget.g1
>
> instead of /sys/bus/gadget/drivers/configfs-gadget.0
>
> Gadget names are guaranteed to be unique because they are created
> as sibling subdirectories in configfs. Your patch would then be greatly
> simplified (no need for ida).

I vote this ways.

Best regards
Frank Li

>
> Regards,
>
> Andrzej
>