Linux USB
 help / color / mirror / Atom feed
From: Daniel Scally <dan.scally@ideasonboard.com>
To: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org,
	laurent.pinchart@ideasonboard.com
Cc: mgr@pengutronix.de, balbi@kernel.org,
	kieran.bingham@ideasonboard.com, torleiv@huddly.com,
	stern@rowland.harvard.edu,
	Daniel Scally <dan.scally@ideasonboard.com>
Subject: [PATCH v3 05/11] usb: gadget: configfs: Rename struct gadget_strings
Date: Mon, 30 Jan 2023 09:34:37 +0000	[thread overview]
Message-ID: <20230130093443.25644-6-dan.scally@ideasonboard.com> (raw)
In-Reply-To: <20230130093443.25644-1-dan.scally@ideasonboard.com>

The struct gadget_strings really represents a single language in
configfs. Rename it to make that more clear.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
---
Changes in v3:

	- New patch

 drivers/usb/gadget/configfs.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 0853536cbf2e..e0f93c42cde6 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -79,7 +79,7 @@ static inline struct gadget_info *cfg_to_gadget_info(struct config_usb_cfg *cfg)
 	return container_of(cfg->c.cdev, struct gadget_info, cdev);
 }
 
-struct gadget_strings {
+struct gadget_language {
 	struct usb_gadget_strings stringtab_dev;
 	struct usb_string strings[USB_GADGET_FIRST_AVAIL_IDX];
 	char *manufacturer;
@@ -365,9 +365,9 @@ static struct configfs_attribute *gadget_root_attrs[] = {
 	NULL,
 };
 
-static inline struct gadget_strings *to_gadget_strings(struct config_item *item)
+static inline struct gadget_language *to_gadget_language(struct config_item *item)
 {
-	return container_of(to_config_group(item), struct gadget_strings,
+	return container_of(to_config_group(item), struct gadget_language,
 			 group);
 }
 
@@ -755,20 +755,20 @@ static const struct config_item_type config_desc_type = {
 	.ct_owner       = THIS_MODULE,
 };
 
-GS_STRINGS_RW(gadget_strings, manufacturer);
-GS_STRINGS_RW(gadget_strings, product);
-GS_STRINGS_RW(gadget_strings, serialnumber);
+GS_STRINGS_RW(gadget_language, manufacturer);
+GS_STRINGS_RW(gadget_language, product);
+GS_STRINGS_RW(gadget_language, serialnumber);
 
-static struct configfs_attribute *gadget_strings_langid_attrs[] = {
-	&gadget_strings_attr_manufacturer,
-	&gadget_strings_attr_product,
-	&gadget_strings_attr_serialnumber,
+static struct configfs_attribute *gadget_language_langid_attrs[] = {
+	&gadget_language_attr_manufacturer,
+	&gadget_language_attr_product,
+	&gadget_language_attr_serialnumber,
 	NULL,
 };
 
-static void gadget_strings_attr_release(struct config_item *item)
+static void gadget_language_attr_release(struct config_item *item)
 {
-	struct gadget_strings *gs = to_gadget_strings(item);
+	struct gadget_language *gs = to_gadget_language(item);
 
 	kfree(gs->manufacturer);
 	kfree(gs->product);
@@ -778,8 +778,8 @@ static void gadget_strings_attr_release(struct config_item *item)
 	kfree(gs);
 }
 
-USB_CONFIG_STRING_RW_OPS(gadget_strings);
-USB_CONFIG_STRINGS_LANG(gadget_strings, gadget_info);
+USB_CONFIG_STRING_RW_OPS(gadget_language);
+USB_CONFIG_STRINGS_LANG(gadget_language, gadget_info);
 
 static inline struct gadget_info *os_desc_item_to_gadget_info(
 		struct config_item *item)
@@ -1316,7 +1316,7 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
 
 	/* init all strings */
 	if (!list_empty(&gi->string_list)) {
-		struct gadget_strings *gs;
+		struct gadget_language *gs;
 
 		i = 0;
 		list_for_each_entry(gs, &gi->string_list, list) {
@@ -1598,7 +1598,7 @@ static struct config_group *gadgets_make(
 	configfs_add_default_group(&gi->configs_group, &gi->group);
 
 	config_group_init_type_name(&gi->strings_group, "strings",
-			&gadget_strings_strings_type);
+			&gadget_language_strings_type);
 	configfs_add_default_group(&gi->strings_group, &gi->group);
 
 	config_group_init_type_name(&gi->os_desc_group, "os_desc",
-- 
2.34.1


  parent reply	other threads:[~2023-01-30  9:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  9:34 [PATCH v3 00/11] Add XU support to UVC Gadget Daniel Scally
2023-01-30  9:34 ` [PATCH v3 01/11] usb: gadget: uvc: Make bSourceID read/write Daniel Scally
2023-01-30  9:34 ` [PATCH v3 02/11] usb: gadget: uvc: Generalise helper functions for reuse Daniel Scally
2023-01-30  9:34 ` [PATCH v3 03/11] usb: gadget: uvc: Allow definition of XUs in configfs Daniel Scally
2023-01-30 20:13   ` kernel test robot
2023-01-30  9:34 ` [PATCH v3 04/11] usb: gadget: uvc: Copy XU descriptors during .bind() Daniel Scally
2023-01-30  9:34 ` Daniel Scally [this message]
2023-01-30  9:34 ` [PATCH v3 06/11] usb: gadget: configfs: Support arbitrary string descriptors Daniel Scally
2023-01-30 14:24   ` kernel test robot
2023-01-30 16:07   ` kernel test robot
2023-01-30 16:37   ` Alan Stern
2023-02-02 13:06     ` Dan Scally
2023-01-30  9:34 ` [PATCH v3 07/11] usb: gadget: configfs: Attach arbitrary strings to cdev Daniel Scally
2023-01-31  7:35   ` Dan Carpenter
2023-02-01  9:50     ` Dan Scally
2023-01-30  9:34 ` [PATCH v3 08/11] usb: gadget: uvc: Allow linking XUs to string descriptors Daniel Scally
2023-01-30  9:34 ` [PATCH v3 09/11] usb: gadget: uvc: Pick up custom string descriptor IDs Daniel Scally
2023-01-30  9:34 ` [PATCH v3 10/11] usb: gadget: uvc: Allow linking function to string descs Daniel Scally
2023-01-30  9:34 ` [PATCH v3 11/11] usb: gadget: uvc: Use custom strings if available Daniel Scally

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230130093443.25644-6-dan.scally@ideasonboard.com \
    --to=dan.scally@ideasonboard.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mgr@pengutronix.de \
    --cc=stern@rowland.harvard.edu \
    --cc=torleiv@huddly.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox