Re: [PATCH][RESEND] usb: gadget: composite: Provide a list of available functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

Uhm, errr.... please disregard this patch as well.
I still get it wrong.

W dniu 09.07.2014 14:15, Andrzej Pietrasiewicz pisze:
When gadgets are composed with configfs the user must know what are the
available function names. The names are parts of usb_f_*.ko
modules' aliases. If a function is compiled as a module, the information
can be found in modules.alias file. But if a function is compiled-in,
there is no way to know the function's name.

This patch adds a sysfs attribute in libcomposite's sys directory to
show functions which are already registered. Functions which are
compiled-in will be in this list as well.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
---

<snip>


diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index bcc2a62..352571b 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1553,13 +1553,36 @@ void unregister_gadget_item(struct config_item *item)
  }

<snip>

  static int __init gadget_cfs_init(void)
  {
  	int ret;

  	config_group_init(&gadget_subsys.su_group);

+	ret = sysfs_create_file(&THIS_MODULE->mkobj.kobj,
+				&sysfs_func_list.attr);

THIS_MODULE is NULL if compiled-in.

AP
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux