aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/configfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/configfs.c')
-rw-r--r--drivers/usb/gadget/configfs.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 2ddcd635ca2a..97142146eead 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1145,15 +1145,15 @@ static struct configfs_item_operations interf_item_ops = {
1145 .store_attribute = usb_os_desc_attr_store, 1145 .store_attribute = usb_os_desc_attr_store,
1146}; 1146};
1147 1147
1148static ssize_t rndis_grp_compatible_id_show(struct usb_os_desc *desc, 1148static ssize_t interf_grp_compatible_id_show(struct usb_os_desc *desc,
1149 char *page) 1149 char *page)
1150{ 1150{
1151 memcpy(page, desc->ext_compat_id, 8); 1151 memcpy(page, desc->ext_compat_id, 8);
1152 return 8; 1152 return 8;
1153} 1153}
1154 1154
1155static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc, 1155static ssize_t interf_grp_compatible_id_store(struct usb_os_desc *desc,
1156 const char *page, size_t len) 1156 const char *page, size_t len)
1157{ 1157{
1158 int l; 1158 int l;
1159 1159
@@ -1171,20 +1171,20 @@ static ssize_t rndis_grp_compatible_id_store(struct usb_os_desc *desc,
1171 return len; 1171 return len;
1172} 1172}
1173 1173
1174static struct usb_os_desc_attribute rndis_grp_attr_compatible_id = 1174static struct usb_os_desc_attribute interf_grp_attr_compatible_id =
1175 __CONFIGFS_ATTR(compatible_id, S_IRUGO | S_IWUSR, 1175 __CONFIGFS_ATTR(compatible_id, S_IRUGO | S_IWUSR,
1176 rndis_grp_compatible_id_show, 1176 interf_grp_compatible_id_show,
1177 rndis_grp_compatible_id_store); 1177 interf_grp_compatible_id_store);
1178 1178
1179static ssize_t rndis_grp_sub_compatible_id_show(struct usb_os_desc *desc, 1179static ssize_t interf_grp_sub_compatible_id_show(struct usb_os_desc *desc,
1180 char *page) 1180 char *page)
1181{ 1181{
1182 memcpy(page, desc->ext_compat_id + 8, 8); 1182 memcpy(page, desc->ext_compat_id + 8, 8);
1183 return 8; 1183 return 8;
1184} 1184}
1185 1185
1186static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc, 1186static ssize_t interf_grp_sub_compatible_id_store(struct usb_os_desc *desc,
1187 const char *page, size_t len) 1187 const char *page, size_t len)
1188{ 1188{
1189 int l; 1189 int l;
1190 1190
@@ -1202,20 +1202,21 @@ static ssize_t rndis_grp_sub_compatible_id_store(struct usb_os_desc *desc,
1202 return len; 1202 return len;
1203} 1203}
1204 1204
1205static struct usb_os_desc_attribute rndis_grp_attr_sub_compatible_id = 1205static struct usb_os_desc_attribute interf_grp_attr_sub_compatible_id =
1206 __CONFIGFS_ATTR(sub_compatible_id, S_IRUGO | S_IWUSR, 1206 __CONFIGFS_ATTR(sub_compatible_id, S_IRUGO | S_IWUSR,
1207 rndis_grp_sub_compatible_id_show, 1207 interf_grp_sub_compatible_id_show,
1208 rndis_grp_sub_compatible_id_store); 1208 interf_grp_sub_compatible_id_store);
1209 1209
1210static struct configfs_attribute *interf_grp_attrs[] = { 1210static struct configfs_attribute *interf_grp_attrs[] = {
1211 &rndis_grp_attr_compatible_id.attr, 1211 &interf_grp_attr_compatible_id.attr,
1212 &rndis_grp_attr_sub_compatible_id.attr, 1212 &interf_grp_attr_sub_compatible_id.attr,
1213 NULL 1213 NULL
1214}; 1214};
1215 1215
1216int usb_os_desc_prepare_interf_dir(struct config_group *parent, 1216int usb_os_desc_prepare_interf_dir(struct config_group *parent,
1217 int n_interf, 1217 int n_interf,
1218 struct usb_os_desc **desc, 1218 struct usb_os_desc **desc,
1219 char **names,
1219 struct module *owner) 1220 struct module *owner)
1220{ 1221{
1221 struct config_group **f_default_groups, *os_desc_group, 1222 struct config_group **f_default_groups, *os_desc_group,
@@ -1257,8 +1258,8 @@ int usb_os_desc_prepare_interf_dir(struct config_group *parent,
1257 d = desc[n_interf]; 1258 d = desc[n_interf];
1258 d->owner = owner; 1259 d->owner = owner;
1259 config_group_init_type_name(&d->group, "", interface_type); 1260 config_group_init_type_name(&d->group, "", interface_type);
1260 config_item_set_name(&d->group.cg_item, "interface.%d", 1261 config_item_set_name(&d->group.cg_item, "interface.%s",
1261 n_interf); 1262 names[n_interf]);
1262 interface_groups[n_interf] = &d->group; 1263 interface_groups[n_interf] = &d->group;
1263 } 1264 }
1264 1265